diff --git a/src/stratis_cli/_error_reporting.py b/src/stratis_cli/_error_reporting.py index a70c8e44b..c89a5ed14 100644 --- a/src/stratis_cli/_error_reporting.py +++ b/src/stratis_cli/_error_reporting.py @@ -36,7 +36,6 @@ from ._actions import BLOCKDEV_INTERFACE, FILESYSTEM_INTERFACE, POOL_INTERFACE from ._errors import ( StratisCliActionError, - StratisCliAggregateError, StratisCliEngineError, StratisCliIncoherenceError, StratisCliParserError, @@ -205,12 +204,6 @@ def _interpret_errors_1( if isinstance(error, StratisCliUserError): return f"It appears that you issued an unintended command: {error}" - # The only situation in which an AggregateError can be raised is if there - # is a problem activating devcies, but the sim engine does not simulate - # activation of locked devices. - if isinstance(error, StratisCliAggregateError): # pragma: no cover - return f"An iterative command generated one or more errors: {error}" - if isinstance(error, StratisCliStratisdVersionError): return ( f"{error}. stratis can execute only the subset of its " diff --git a/src/stratis_cli/_errors.py b/src/stratis_cli/_errors.py index 88357b372..677e7009d 100644 --- a/src/stratis_cli/_errors.py +++ b/src/stratis_cli/_errors.py @@ -15,9 +15,6 @@ Error heirarchy for stratis cli. """ -# isort: STDLIB -import os - from ._stratisd_constants import ( BLOCK_DEV_TIER_TO_NAME, STRATISD_ERROR_TO_NAME, @@ -428,32 +425,6 @@ def __str__(self): ) -class StratisCliAggregateError(StratisCliRuntimeError): - """ - Raised when multiple errors have occured in a looping operation. - """ - - def __init__(self, operation, type_, errors): - """ - Initializer. - :param str operation: the looping operation that failed. - :param str type_: the type of the resource for which the operation failed. - :param errors: list of all errors that occurred during the looping operation. - :type errors: list of Exception - """ - # pylint: disable=super-init-not-called - self.operation = operation - self.type = type_ - self.errors = errors - - def __str__(self): - return ( - f"The operation '{self.operation}' on a resource of type {self.type} failed. " - f"The following errors occurred:\n" - f"{os.linesep.join([str(error) for error in self.errors])}" - ) - - class StratisCliPartialFailureError(StratisCliRuntimeError): """ A non-fatal error to be reported at the end as part of a StratisCliAggregateError. diff --git a/tests/whitebox/unittest/test_error_fmt.py b/tests/whitebox/unittest/test_error_fmt.py index bdbe94a06..0aec1ff55 100644 --- a/tests/whitebox/unittest/test_error_fmt.py +++ b/tests/whitebox/unittest/test_error_fmt.py @@ -20,8 +20,6 @@ # isort: LOCAL from stratis_cli._errors import ( - StratisCliAggregateError, - StratisCliEngineError, StratisCliGenerationError, StratisCliIncoherenceError, StratisCliPartialFailureError, @@ -59,16 +57,6 @@ def test_stratis_cli_generation_error_fmt(self): """ self._string_not_empty(StratisCliGenerationError("Error")) - def test_stratis_cli_aggregate_error_fmt(self): - """ - Test 'StratisCliAggregateError' - """ - self._string_not_empty( - StratisCliAggregateError( - "do lots of things", "toy", [StratisCliEngineError(1, "bad")] - ) - ) - def test_stratis_cli_partial_failure_error(self): """ Test 'StratisCliPartialFailureError'