From 61f1f1507b48b4e5f33169059230b58daed42c5e Mon Sep 17 00:00:00 2001 From: jinyoungmoonDEV Date: Fri, 29 Nov 2024 17:25:15 +0900 Subject: [PATCH] fix: fix error directory path --- src/plugin/error/__init__.py | 15 +++++++++++++++ src/plugin/error/custom.py | 4 ++++ 2 files changed, 19 insertions(+) create mode 100644 src/plugin/error/__init__.py create mode 100644 src/plugin/error/custom.py diff --git a/src/plugin/error/__init__.py b/src/plugin/error/__init__.py new file mode 100644 index 0000000..47e6a89 --- /dev/null +++ b/src/plugin/error/__init__.py @@ -0,0 +1,15 @@ +import inspect, pkgutil + +__all__ = [] + +for loader, module_name, is_pkg in pkgutil.walk_packages(__path__): + module = loader.find_module(module_name).load_module(module_name) + if hasattr(module, '__all__'): + for target in getattr(module, '__all__'): + globals()[target] = getattr(module, target) + __all__.append(target) + else: + for name, object in inspect.getmembers(module): + if inspect.isclass(object) or inspect.isfunction(object): + globals()[name] = object + __all__.append(name) diff --git a/src/plugin/error/custom.py b/src/plugin/error/custom.py new file mode 100644 index 0000000..fb77883 --- /dev/null +++ b/src/plugin/error/custom.py @@ -0,0 +1,4 @@ +from spaceone.core.error import ERROR_BASE + +class ERROR_VULNERABLE_PORTS(ERROR_BASE): + _message = 'Vulnerable port option settings are incorrect. : {vulnerable_ports}' \ No newline at end of file