Bug 880641 - RHEVM-CLI: Wrong name of section in .rhevmshell causes to traceback when running rhevm-shell
RHEVM-CLI: Wrong name of section in .rhevmshell causes to traceback when runn...
Status: CLOSED ERRATA
Product: Red Hat Enterprise Virtualization Manager
Classification: Red Hat
Component: ovirt-engine-cli (Show other bugs)
3.2.0
Unspecified Unspecified
unspecified Severity unspecified
: ---
: 3.2.0
Assigned To: Michael Pasternak
Ilia Meerovich
infra
:
Depends On:
Blocks: 915537
  Show dependency treegraph
 
Reported: 2012-11-27 08:33 EST by Ilia Meerovich
Modified: 2016-02-10 14:08 EST (History)
9 users (show)

See Also:
Fixed In Version: SF4
Doc Type: Bug Fix
Doc Text:
A misnamed section in 'settings.py' prevented '.rhevmshellrc' from connecting to the interface, resulting in an error. The relevant section has been corrected and using '.rhevmshellrc' to connect to the interface now works as expected.
Story Points: ---
Clone Of:
Environment:
Last Closed: 2013-06-10 16:28:57 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: Infra
RHEL 7.3 requirements from Atomic Host:


Attachments (Terms of Use)

  None (edit)
Description Ilia Meerovich 2012-11-27 08:33:11 EST
.rhevmshellrc should be validated before used (or find another approach to solve this issue):

[imeerovi@imeerovi ART]$ cat ~/.rhevmshellrc
[rhevm-shell]
username = "admin@internal"
url = "https://jenkins-vm-16.qa.lab.tlv.redhat.com:443/api/"
insecure = True
#filter = False
#timeout = -1
password = 123456
[imeerovi@imeerovi ART]$ /usr/bin/rhevm-shell -c -I
Traceback (most recent call last):
  File "/usr/bin/rhevm-shell", line 9, in <module>
    load_entry_point('rhevm-shell==3.1.0.17-SNAPSHOT', 'console_scripts', 'rhevm-shell')()
  File "/usr/lib/python2.6/site-packages/ovirtcli/main.py", line 27, in main
    context = OvirtCliExecutionContext(sys.argv, parser)
  File "/usr/lib/python2.6/site-packages/ovirtcli/context.py", line 45, in __init__
    super(OvirtCliExecutionContext, self).__init__(args=args, option_parser=option_parser)
  File "/usr/lib/python2.6/site-packages/cli/context.py", line 70, in __init__
    self._load_settings()
  File "/usr/lib/python2.6/site-packages/cli/context.py", line 120, in _load_settings
    found, old_format = self.settings.load_config_file()
  File "/usr/lib/python2.6/site-packages/cli/settings.py", line 120, in load_config_file
    self[conf_key] = value
  File "/usr/lib/python2.6/site-packages/cli/settings.py", line 91, in __setitem__
    raise KeyError, 'unknown setting: %s' % key
KeyError: 'unknown setting: rhevm-shell:username'
Comment 1 Michael Pasternak 2012-11-27 08:43:54 EST
can you provide reproducer? i.e conf file content + your cli version
Comment 2 Ilia Meerovich 2012-11-27 09:44:05 EST
sure:
I did cat of my .rhevmshellrc at first message:
[rhevm-shell]
username = "admin@internal"
url = "https://jenkins-vm-16.qa.lab.tlv.redhat.com:443/api/"
insecure = True
#filter = False
#timeout = -1
password = 123456
Comment 3 Ilia Meerovich 2012-11-27 09:45:45 EST
[imeerovi@imeerovi ART]$ rpm -qa | grep rhevm-cli
rhevm-cli-3.1.0.17-1.el6ev.noarch
[imeerovi@imeerovi ART]$
Comment 4 Michael Pasternak 2012-12-13 05:47:26 EST
http://gerrit.ovirt.org/10023
Comment 5 Ilia Meerovich 2013-02-05 04:39:48 EST
[imeerovi@imeerovi ART]$ /usr/bin/rhevm-shell -c --url=https://leonid_rhevm.qa.lab.tlv.redhat.com:443/api/ -u admin@internal -I
Traceback (most recent call last):
  File "/usr/bin/rhevm-shell", line 9, in <module>
    load_entry_point('rhevm-shell==3.2.0.3-SNAPSHOT', 'console_scripts', 'rhevm-shell')()
  File "/usr/lib/python2.6/site-packages/ovirtcli/main.py", line 27, in main
    context = OvirtCliExecutionContext(sys.argv, parser)
  File "/usr/lib/python2.6/site-packages/ovirtcli/context.py", line 45, in __init__
    super(OvirtCliExecutionContext, self).__init__(args=args, option_parser=option_parser)
  File "/usr/lib/python2.6/site-packages/cli/context.py", line 72, in __init__
    self._load_settings()
  File "/usr/lib/python2.6/site-packages/cli/context.py", line 128, in _load_settings
    found, old_format = self.settings.load_config_file()
  File "/usr/lib/python2.6/site-packages/cli/settings.py", line 115, in load_config_file
    if not cp.read(fname):
  File "/usr/lib64/python2.6/ConfigParser.py", line 286, in read
    self._read(fp, filename)
  File "/usr/lib64/python2.6/ConfigParser.py", line 482, in _read
    raise MissingSectionHeaderError(fpname, lineno, line)
ConfigParser.MissingSectionHeaderError: File contains no section headers.
file: /home/imeerovi/.rhevmshellrc, line: 1
'username = \n'
[imeerovi@imeerovi ART]$ fg
vim /home/imeerovi/.rhevmshellrc
[imeerovi@imeerovi ART]$ cat /home/imeerovi/.rhevmshellrc 
username = 
url = 
insecure = False
no_paging = False
filter = False
timeout = -1
password = 123456 
[imeerovi@imeerovi ART]$ rpm -q rhevm-cli
rhevm-cli-3.2.0.3-1.el6ev.noarch
Comment 6 Michael Pasternak 2013-02-05 04:57:25 EST
(In reply to comment #5)
> [imeerovi@imeerovi ART]$ /usr/bin/rhevm-shell -c
> --url=https://leonid_rhevm.qa.lab.tlv.redhat.com:443/api/ -u admin@internal
> -I
> Traceback (most recent call last):
>   File "/usr/bin/rhevm-shell", line 9, in <module>
>     load_entry_point('rhevm-shell==3.2.0.3-SNAPSHOT', 'console_scripts',
> 'rhevm-shell')()
>   File "/usr/lib/python2.6/site-packages/ovirtcli/main.py", line 27, in main
>     context = OvirtCliExecutionContext(sys.argv, parser)
>   File "/usr/lib/python2.6/site-packages/ovirtcli/context.py", line 45, in
> __init__
>     super(OvirtCliExecutionContext, self).__init__(args=args,
> option_parser=option_parser)
>   File "/usr/lib/python2.6/site-packages/cli/context.py", line 72, in
> __init__
>     self._load_settings()
>   File "/usr/lib/python2.6/site-packages/cli/context.py", line 128, in
> _load_settings
>     found, old_format = self.settings.load_config_file()
>   File "/usr/lib/python2.6/site-packages/cli/settings.py", line 115, in
> load_config_file
>     if not cp.read(fname):
>   File "/usr/lib64/python2.6/ConfigParser.py", line 286, in read
>     self._read(fp, filename)
>   File "/usr/lib64/python2.6/ConfigParser.py", line 482, in _read
>     raise MissingSectionHeaderError(fpname, lineno, line)
> ConfigParser.MissingSectionHeaderError: File contains no section headers.
> file: /home/imeerovi/.rhevmshellrc, line: 1
> 'username = \n'
> [imeerovi@imeerovi ART]$ fg
> vim /home/imeerovi/.rhevmshellrc
> [imeerovi@imeerovi ART]$ cat /home/imeerovi/.rhevmshellrc 
> username = 
> url = 
> insecure = False
> no_paging = False
> filter = False
> timeout = -1
> password = 123456 
> [imeerovi@imeerovi ART]$ rpm -q rhevm-cli
> rhevm-cli-3.2.0.3-1.el6ev.noarch

ilia,

This is not what you've initially reported, you reported that "Wrong name of section [1] in .rhevmshell causes traceback",

now you removing "section header" [2], please file another bug on this and verify this one according to your original complaint.

[1] s/username=/usernameXXXX=
[2] s/[ovirt-shell]/nill
Comment 7 Ilia Meerovich 2013-02-07 07:28:55 EST
will file another bug
Comment 8 errata-xmlrpc 2013-06-10 16:28:57 EDT
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

http://rhn.redhat.com/errata/RHBA-2013-0890.html

Note You need to log in before you can comment on or make changes to this bug.