Add charm's directory to syspath
charmhelpers lives in the charm dir and it needs to be added to the syspath to allow the openstack-upgrade action find it. This wasn't needed until commitb45cd2ae
removed the symlink that was left in the hooks/ directory for backward compatibility purposes. Change-Id: I7be5d16359aa6c78c9241990c3d3b8bab4910538 Closes-Bug: 1802182 (cherry picked from commit41a046ba82
)
This commit is contained in:
parent
a297f8afc1
commit
67c9cdf204
|
@ -31,6 +31,18 @@ _add_path(_parent)
|
|||
_add_path(_hooks)
|
||||
|
||||
|
||||
_path = os.path.dirname(os.path.realpath(__file__))
|
||||
_parent = os.path.abspath(os.path.join(_path, ".."))
|
||||
|
||||
|
||||
def _add_path(path):
|
||||
if path not in sys.path:
|
||||
sys.path.insert(1, path)
|
||||
|
||||
|
||||
_add_path(_parent)
|
||||
|
||||
|
||||
from charmhelpers.contrib.openstack.utils import (
|
||||
do_action_openstack_upgrade,
|
||||
)
|
||||
|
|
Loading…
Reference in New Issue