Merge "Add charmhelpers to sys.path in first position for actions"
This commit is contained in:
commit
ff049db72c
@ -3,7 +3,17 @@
|
|||||||
import os
|
import os
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
sys.path.append('hooks/')
|
_path = os.path.dirname(os.path.realpath(__file__))
|
||||||
|
_hooks_dir = os.path.abspath(os.path.join(_path, "..", "hooks"))
|
||||||
|
|
||||||
|
|
||||||
|
def _add_path(path):
|
||||||
|
if path not in sys.path:
|
||||||
|
sys.path.insert(1, path)
|
||||||
|
|
||||||
|
|
||||||
|
_add_path(_hooks_dir)
|
||||||
|
|
||||||
|
|
||||||
from charmhelpers.core.hookenv import action_fail
|
from charmhelpers.core.hookenv import action_fail
|
||||||
from neutron_utils import (
|
from neutron_utils import (
|
||||||
|
@ -1,7 +1,18 @@
|
|||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
|
import os
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
sys.path.append('hooks/')
|
_path = os.path.dirname(os.path.realpath(__file__))
|
||||||
|
_hooks_dir = os.path.abspath(os.path.join(_path, "..", "hooks"))
|
||||||
|
|
||||||
|
|
||||||
|
def _add_path(path):
|
||||||
|
if path not in sys.path:
|
||||||
|
sys.path.insert(1, path)
|
||||||
|
|
||||||
|
|
||||||
|
_add_path(_hooks_dir)
|
||||||
|
|
||||||
|
|
||||||
from charmhelpers.contrib.openstack.utils import (
|
from charmhelpers.contrib.openstack.utils import (
|
||||||
do_action_openstack_upgrade,
|
do_action_openstack_upgrade,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user