Bug 841215 - rhn virtual poller.py returns: ImportError('local vdsm not found')
rhn virtual poller.py returns: ImportError('local vdsm not found')
Status: CLOSED DUPLICATE of bug 820862
Product: Red Hat Satellite 5
Classification: Red Hat
Component: Virtualization (Show other bugs)
541
All Linux
medium Severity medium
: ---
: ---
Assigned To: Milan Zazrivec
Red Hat Satellite QA List
:
Depends On:
Blocks: sat550-blockers
  Show dependency treegraph
 
Reported: 2012-07-18 08:45 EDT by Roman Hodain
Modified: 2012-08-10 05:32 EDT (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2012-08-10 05:32:32 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Roman Hodain 2012-07-18 08:45:32 EDT
Description of problem:

We see the following when we run /usr/share/rhn/virtualization/poller.pyc:
Traceback (most recent call last):
  File "/usr/lib64/python2.6/runpy.py", line 122, in _run_module_as_main
    "__main__", fname, loader, pkg_name)
  File "/usr/lib64/python2.6/runpy.py", line 34, in _run_code
    exec code in run_globals
  File "/usr/lib64/python2.6/trace.py", line 823, in <module>
    main()
  File "/usr/lib64/python2.6/trace.py", line 811, in main
    t.runctx(code, globs, globs)
  File "/usr/lib64/python2.6/trace.py", line 512, in runctx
    exec cmd in globals, locals
  File "/usr/share/rhn/virtualization/poller.py", line 290, in <module>
    domain_list = poll_through_vdsm()
  File "/usr/share/rhn/virtualization/poller.py", line 140, in poll_through_vdsm
    import localvdsm
  File "/usr/share/rhn/virtualization/localvdsm.py", line 35, in <module>
    raise ImportError('local vdsm not found')

ENV:
  RHE:-H 6.3
  vdsm-4.9-113.1.el6.x86_64
  rhn-virtualization-common-5.4.14-9.el6sat.noarch

Version-Release number of selected component (if applicable):
  rhn-virtualization-host-5.4.14-9.el6sat.noarch  
  rhn-virtualization-common-5.4.14-9.el6sat.noarch
  vdsm-4.9-113.1.el6.x86_64

How reproducible:
  Always

Steps to Reproduce:
  Install on the latest RHEL-H and run
    # python /usr/share/rhn/virtualization/poller.py
  
Actual results:
  Traceback (most recent call last):
  File "/usr/lib64/python2.6/runpy.py", line 122, in _run_module_as_main
    "__main__", fname, loader, pkg_name)
  File "/usr/lib64/python2.6/runpy.py", line 34, in _run_code
    exec code in run_globals
  File "/usr/lib64/python2.6/trace.py", line 823, in <module>
    main()
  File "/usr/lib64/python2.6/trace.py", line 811, in main
    t.runctx(code, globs, globs)
  File "/usr/lib64/python2.6/trace.py", line 512, in runctx
    exec cmd in globals, locals
  File "/usr/share/rhn/virtualization/poller.py", line 290, in <module>
    domain_list = poll_through_vdsm()
  File "/usr/share/rhn/virtualization/poller.py", line 140, in poll_through_vdsm
    import localvdsm
  File "/usr/share/rhn/virtualization/localvdsm.py", line 35, in <module>
    raise ImportError('local vdsm not found')

Expected results:
  No exception. The script should be able to connect to the local VDSM

Additional info:

I did some research and I found out the this is issue is most probably located in /usr/share/vdsm/config.py. This is loaded in localvdsm.py that is loaded by poller.py
We try to import module "constants" and then use some constants from the module
   grep -n constants /usr/share/vdsm/config.py
     3:import constants
     69:config.set('vars', 'trust_store_path', constants.P_TRUSTSTORE)
     131:config.set('irs', 'pools_data_dir', constants.P_STORAGEPOOLS)
     133:config.set('irs', 'lock_util_path', constants.P_VDSM_LIBEXEC)
     140:config.set('irs', 'md_backup_dir', constants.P_VDSM_BACKUP)
     166:config.read([constants.P_VDSM_CONF + 'vdsm.conf'])

The constants module that we are interested in is located in /usr/share/vdsm/constants.py
The problem is that there is also a constants module located in /usr/share/rhn/virtualization/constants.py that is loaded by /usr/share/rhn/virtualization/poller.py
So we end up with a wrong module loaded.
Comment 1 Clifford Perry 2012-07-18 11:35:41 EDT
Interesting, this is related I think to bug 820862.
Comment 4 Milan Zazrivec 2012-08-10 05:32:32 EDT

*** This bug has been marked as a duplicate of bug 820862 ***

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