juju / juju-gui-charm

Charm for Juju GUI.
GNU Affero General Public License v3.0
2 stars 16 forks source link

cs:trusty/juju-gui-50: all hooks fail on import get_config from charmhelpers #45

Closed lathiat closed 8 years ago

lathiat commented 8 years ago

cs:trusty/juju-gui-50 appears broken as the hooks fail to execute with an ImportError. This occurs both on clean install and on upgrade from cs:trusty/juju-gui-49

2016-03-10 03:40:22 INFO upgrade-charm Traceback (most recent call last): 2016-03-10 03:40:22 INFO upgrade-charm File "/var/lib/juju/agents/unit-juju-gui-0/charm/hooks/upgrade-charm", line 7, in 2016-03-10 03:40:22 INFO upgrade-charm from charmhelpers import ( 2016-03-10 03:40:22 INFO upgrade-charm ImportError: cannot import name get_config 2016-03-10 03:40:22 ERROR juju.worker.uniter.operation runhook.go:107 hook "upgrade-charm" failed: exit status 1

It appears like the conversion to new charmhelpers is half complete in this release. We have both charmhelpers.py and charmhelpers/* .. and the code is using the old style.

lathiat commented 8 years ago

Looks like the .pyc files for charmhelpers/ are left behind, possibly due to lack of "git clean" or similar after moving from a branch with the new charmhelpers, to one without.

Removing the charmhelpers directory seems to fix the issue.

root@maas-juju:/var/lib/juju/agents/unit-juju-gui-0/charm/hooks# find charmhelpers charmhelpers charmhelpers/contrib charmhelpers/contrib/charmhelpers charmhelpers/contrib/charmhelpers/init.pyc charmhelpers/contrib/init.pyc charmhelpers/core charmhelpers/core/host.pyc charmhelpers/core/fstab.pyc charmhelpers/core/init.pyc charmhelpers/core/hookenv.pyc charmhelpers/init.pyc

bac commented 8 years ago

Thanks @lathiat -- for the 2.0.3 version of the charm that charmhelpers directory should not have been there. I've uploaded a new version that is correct.