From bf178babd96ee5b898f0dfa1f6e7d5a74fe34afd Mon Sep 17 00:00:00 2001 From: John Estabrook Date: Mon, 22 Aug 2022 10:35:52 -0500 Subject: graphql: T4544: fix for directly running on system for testing --- src/services/api/graphql/utils/schema_from_op_mode.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/services') 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'] -- cgit v1.2.3