Skip to content

Commit b341e11

Browse files
[show][config][plugin] add processing of ModuleNotFoundError with warning log message instead of default error message
Avoid excess error messages for cases of race conditions when plugin was removed right before the stage of its loading Signed-off-by: Maksym Kovalchuk <mkovalchuk@nvidia.com>
1 parent 2aa7a82 commit b341e11

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

utilities_common/util_base.py

+5
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,11 @@ def iter_namespace(ns_pkg):
2929
log.log_debug('importing plugin: {}'.format(module_name))
3030
try:
3131
module = importlib.import_module(module_name)
32+
except ModuleNotFoundError as err:
33+
log.log_warning('failed to import plugin {}: {}'.format(module_name, err),
34+
also_print_to_console=True)
35+
continue
36+
3237
except Exception as err:
3338
log.log_error('failed to import plugin {}: {}'.format(module_name, err),
3439
also_print_to_console=True)

0 commit comments

Comments
 (0)