diff --git a/muranoapi/cmd/api.py b/muranoapi/cmd/api.py index d97fbf9c1..182435ef9 100644 --- a/muranoapi/cmd/api.py +++ b/muranoapi/cmd/api.py @@ -13,8 +13,16 @@ # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. - +import os import sys +# If ../muranoapi/__init__.py exists, add ../ to Python search path, so that +# it will override what happens to be installed in /usr/(local/)lib/python... +possible_topdir = os.path.normpath(os.path.join(os.path.abspath(__file__), + os.pardir, + os.pardir, + os.pardir)) +if os.path.exists(os.path.join(possible_topdir, 'muranoapi', '__init__.py')): + sys.path.insert(0, possible_topdir) from muranoapi.common import config from muranoapi.common.service import TaskResultHandlerService