Merge "Add charmhelpers to sys.path in first position for actions"

This commit is contained in:
Zuul 2018-11-26 16:06:05 +00:00 committed by Gerrit Code Review
commit ff049db72c
2 changed files with 23 additions and 2 deletions

View File

@ -3,7 +3,17 @@
import os
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 neutron_utils import (

View File

@ -1,7 +1,18 @@
#!/usr/bin/env python3
import os
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 (
do_action_openstack_upgrade,