From 989eb0f0f40f1a3545af2b02b82cdc49210dafe6 Mon Sep 17 00:00:00 2001 From: BryantHe Date: Thu, 27 Jul 2023 16:13:12 +0800 Subject: [PATCH] debug 4 --- namekoplus/command.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/namekoplus/command.py b/namekoplus/command.py index ea9d5eb..c095e12 100644 --- a/namekoplus/command.py +++ b/namekoplus/command.py @@ -317,15 +317,15 @@ def metric_config_gen(module, class_name_str): """ Generate metric config for nameko services. """ - from statsd.client.timer import Timer - import sys + from statsd.client.timer import Timer + sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe()))))) click.echo(f'sys.path: {sys.path}') # Extract information of statsd config from the class of nameko service dest_dir = module.split('.')[0] file_name = module.split('.')[-1] - _module = importlib.import_module(name='.'+file_name, package=dest_dir) + _module = importlib.import_module(module) config_list = [] for class_name in class_name_str.split(','): members = inspect.getmembers(getattr(getattr(_module, file_name), class_name), predicate=inspect.isfunction)