Remove redundant path change and fix relative path change

Although this charm is rooted in 'hooks' (which is probably an error),
the actions were still using relative to root sys.path changes.  This
makes them absolute, which helps to tidy the path.  The charm should be
change to be rooted in the charm dir, and that requires more significant
changes to the unit tests.

Change-Id: I972f0a72a31ef313828a785ae1e30e0ecad427a6
This commit is contained in:
Alex Kavanagh 2018-11-08 10:43:42 +00:00
parent 41a046ba82
commit 0353df7e28
2 changed files with 2 additions and 4 deletions

View File

@ -33,8 +33,6 @@ _add_path(_hooks)
from charmhelpers.core.hookenv import action_fail
sys.path.append('hooks/')
from glance_utils import (
pause_unit_helper,
resume_unit_helper,

View File

@ -19,6 +19,7 @@ import sys
_path = os.path.dirname(os.path.realpath(__file__))
_parent = os.path.abspath(os.path.join(_path, ".."))
_hooks = os.path.abspath(os.path.join(_parent, "hooks"))
def _add_path(path):
@ -27,14 +28,13 @@ def _add_path(path):
_add_path(_parent)
_add_path(_hooks)
from charmhelpers.contrib.openstack.utils import (
do_action_openstack_upgrade,
)
sys.path.append('hooks/')
from glance_relations import (
config_changed,
CONFIGS