Bug 1119747

Summary: confusing behavior of lmi.shell.connect on failure in python
Product: [Fedora] Fedora Reporter: Alois Mahdal <amahdal>
Component: openlmi-toolsAssignee: Peter Hatina <phatina>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 20CC: agk, miminar, phatina, tsmetana
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: openlmi-tools-0.9.2-2.fc20 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-07-29 02:08:01 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Alois Mahdal 2014-07-15 12:27:25 UTC
Description of problem:

The way how lmi.shell.connect responds when using /usr/bin/python, I try to connect to a local to CIM that is not started is confusing:

    # python
    Python 2.7.5 (default, Jun 25 2014, 10:19:55) 
    [GCC 4.8.2 20131212 (Red Hat 4.8.2-7)] on linux2
    Type "help", "copyright", "credits" or "license" for more information.
    >>> import lmi.shell
    >>> c = lmi.shell.connect("https://my.fqdn/", "pegasus", "aaa")
    No handlers could be found for logger "lmi.shell.LMIConnection"
    >>> repr(c)
    'None'
    >>> c = lmi.shell.connect("https://my.fqdn/", "pegasus", "aaa")
    >>> repr(c)
    'None'
    >>> # bring up Pegasus and try again
    ... 
    >>> c = lmi.shell.connect("https://my.fqdn/", "pegasus", "aaa")
    >>> repr(c)
    'None'

 *  First, the message about logger handlers is cleatly confusing.

 *  From that point, the connect() somehow "remembers" this, and does not
    throw the message again: it simply keeps returning None without any
    comments.

 *  Even if I fix the problem, connect does not notice; it keeps just
    silently returning None for the rest of the session.


Version-Release number of selected component (if applicable):
openlmi-tools-0.9.1-3.fc20.noarch

How reproducible:
Always

Steps to Reproduce:
 1. do not start Pegasus
 2. open interactive python session
 3. import lmi.shell and try to connect() to the (not running) CIMOM

Actual results:
Confusing message on first attempt, next attempts seem to "do nothing" (even after starting CIMOM)

Expected results:
Exception or rval with useful message, after starting CIMOM I expect connect() to start working properly


Additional info:

This is not limited only to case when CIMOM is not running.  It also happens if e.g. there is additional "/" in the URI.  (I suspect this happens with all errors.)

Comment 1 Fedora Update System 2014-07-16 13:03:04 UTC
openlmi-tools-0.9.2-2.fc20 has been submitted as an update for Fedora 20.
https://admin.fedoraproject.org/updates/openlmi-tools-0.9.2-2.fc20

Comment 2 Fedora Update System 2014-07-17 04:29:59 UTC
Package openlmi-tools-0.9.2-2.fc20:
* should fix your issue,
* was pushed to the Fedora 20 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing openlmi-tools-0.9.2-2.fc20'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2014-8400/openlmi-tools-0.9.2-2.fc20
then log in and leave karma (feedback).

Comment 3 Fedora Update System 2014-07-29 02:08:01 UTC
openlmi-tools-0.9.2-2.fc20 has been pushed to the Fedora 20 stable repository.  If problems still persist, please make note of it in this bug report.