summaryrefslogtreecommitdiff
path: root/src/services
diff options
context:
space:
mode:
authorJohn Estabrook <jestabro@vyos.io>2022-08-22 10:35:52 -0500
committerJohn Estabrook <jestabro@vyos.io>2022-08-22 12:05:49 -0500
commitbf178babd96ee5b898f0dfa1f6e7d5a74fe34afd (patch)
treefe66e7564c3c689495d47e1b95457a147aeddae1 /src/services
parent8eede91cd25242370543c8af139b716e46fcbd41 (diff)
downloadvyos-1x-bf178babd96ee5b898f0dfa1f6e7d5a74fe34afd.tar.gz
vyos-1x-bf178babd96ee5b898f0dfa1f6e7d5a74fe34afd.zip
graphql: T4544: fix for directly running on system for testing
Diffstat (limited to 'src/services')
-rwxr-xr-xsrc/services/api/graphql/utils/schema_from_op_mode.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/services/api/graphql/utils/schema_from_op_mode.py b/src/services/api/graphql/utils/schema_from_op_mode.py
index d27586747..f990aae52 100755
--- a/src/services/api/graphql/utils/schema_from_op_mode.py
+++ b/src/services/api/graphql/utils/schema_from_op_mode.py
@@ -25,7 +25,10 @@ from inspect import signature, getmembers, isfunction
from jinja2 import Template
from vyos.defaults import directories
-from . util import load_as_module, is_op_mode_function_name, is_show_function_name
+if __package__ is None or __package__ == '':
+ from util import load_as_module, is_op_mode_function_name, is_show_function_name
+else:
+ from . util import load_as_module, is_op_mode_function_name, is_show_function_name
OP_MODE_PATH = directories['op_mode']
SCHEMA_PATH = directories['api_schema']