diff --git a/SoftLayer/CLI/object_storage/credential/__init__.py b/SoftLayer/CLI/object_storage/credential/__init__.py index 1f71754bb..f3bc2723a 100644 --- a/SoftLayer/CLI/object_storage/credential/__init__.py +++ b/SoftLayer/CLI/object_storage/credential/__init__.py @@ -32,8 +32,12 @@ def get_command(self, ctx, cmd_name): """Get command for click.""" path = "%s.%s" % (__name__, cmd_name) path = path.replace("-", "_") - module = importlib.import_module(path) - return getattr(module, 'cli') + try: + module = importlib.import_module(path) + return getattr(module, 'cli') + except ModuleNotFoundError as ex: + print(ex.name) + return None # Required to get the sub-sub-sub command to work. diff --git a/SoftLayer/CLI/virt/capacity/__init__.py b/SoftLayer/CLI/virt/capacity/__init__.py index 3f891c194..21ff940ad 100644 --- a/SoftLayer/CLI/virt/capacity/__init__.py +++ b/SoftLayer/CLI/virt/capacity/__init__.py @@ -37,8 +37,12 @@ def get_command(self, ctx, cmd_name): """Get command for click.""" path = "%s.%s" % (__name__, cmd_name) path = path.replace("-", "_") - module = importlib.import_module(path) - return getattr(module, 'cli') + try: + module = importlib.import_module(path) + return getattr(module, 'cli') + except ModuleNotFoundError as ex: + print(ex.name) + return None # Required to get the sub-sub-sub command to work. diff --git a/SoftLayer/CLI/virt/placementgroup/__init__.py b/SoftLayer/CLI/virt/placementgroup/__init__.py index aa748a5b1..1aa89a16e 100644 --- a/SoftLayer/CLI/virt/placementgroup/__init__.py +++ b/SoftLayer/CLI/virt/placementgroup/__init__.py @@ -36,8 +36,12 @@ def get_command(self, ctx, cmd_name): """Get command for click.""" path = "%s.%s" % (__name__, cmd_name) path = path.replace("-", "_") - module = importlib.import_module(path) - return getattr(module, 'cli') + try: + module = importlib.import_module(path) + return getattr(module, 'cli') + except ModuleNotFoundError as ex: + print(ex.name) + return None # Required to get the sub-sub-sub command to work.