Skip to content

Commit 99d5e4b

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 99d5e4b

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

utilities_common/util_base.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,11 @@ def iter_namespace(ns_pkg):
3030
try:
3131
module = importlib.import_module(module_name)
3232
except Exception as err:
33+
if isinstance(err, ModuleNotFoundError):
34+
log.log_warning('failed to import plugin {}: {}'.format(module_name, err),
35+
also_print_to_console=True)
36+
continue
37+
3338
log.log_error('failed to import plugin {}: {}'.format(module_name, err),
3439
also_print_to_console=True)
3540
continue

0 commit comments

Comments
 (0)