Python-heatclient fails with 'Empty module name' when using relative path

Bug #1539607 reported by Harri Heikkilä
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
python-heatclient
New
Undecided
zhaozhilong

Bug Description

You get error message as described in https://bugs.launchpad.net/horizon/+bug/1475279 horizon fails because heatclient cannot handle relative path (../..)

but when you change Line 8 in /usr/local/lib/python2.7/dist-packages/openstack_dashboard/wsgi/django.wsgi from:
sys.path.insert(0, os.path.join(os.path.dirname(os.path.realpath(__file__)), '../..')) to absolute path:
sys.path.insert(0, os.path.join(os.path.dirname(os.path.realpath(__file__)), '/usr/local/lib/python2.7/dist-packages'))

Then the error goes away.
Based on in bug 1475279 comment:
"Matthias Runge (mrunge) wrote on 2015-07-20:
then it's a heatclient issue (missing dependency)"
I could guess that this is heat client issue then. Or simply configuration issue, but hard to see where.

I can confirm that Error occurs also when installing horizon (stable/liberty) from sources:

Jan 29 12:27:55 controlplane01 '[horizon]'[27138]:
Jan 29 12:27:55 controlplane01 '[horizon]'[27138]: utils.import_modules_from_package("osprofiler._notifiers")
Jan 29 12:27:55 controlplane01 '[horizon]'[27138]: File "/usr/local/lib/python2.7/dist-packages/openstack_dashboard/wsgi/../../osprofiler/_utils.py", line 174, in import_modules_from_package
Jan 29 12:27:55 controlplane01 '[horizon]'[27138]:
Jan 29 12:27:55 controlplane01 '[horizon]'[27138]: __import__(module_name)
Jan 29 12:27:55 controlplane01 '[horizon]'[27138]: ValueError
Jan 29 12:27:55 controlplane01 '[horizon]'[27138]: :
Jan 29 12:27:55 controlplane01 '[horizon]'[27138]: Empty module name
Jan 29 12:27:55 controlplane01 '[horizon]'[27138]:
Jan 29 12:27:55 controlplane01 '[horizon]'[27138]: unable to load app 0 (mountpoint='') (callable not found or import error)

Changed in python-heatclient:
assignee: nobody → zhaozhilong (zhaozhilong)
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.