Skip to content

Commit 6b5b3a3

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 6b5b3a3

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

utilities_common/util_base.py

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

0 commit comments

Comments
 (0)