diff --git a/CHANGELOG.md b/CHANGELOG.md index a4160f6..f459bdb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,12 +1,12 @@ # Changelog +## [Unreleased][] + ### Added * MSK probes `chaosaws.msk.probes.describe_msk_cluster` `chaosaws.msk.probes.get_bootstrap_servers` * MSK actions `chaosaws.msk.actions.reboot_msk_broker` `chaosaws.msk.actions.delete_cluster` -## [Unreleased][] - [Unreleased]: https://github.com/chaostoolkit-incubator/chaostoolkit-aws/compare/0.33.0...HEAD ## [0.33.0][] - 2024-02-26 diff --git a/chaosaws/msk/actions.py b/chaosaws/msk/actions.py index 2443fbf..a6432b5 100644 --- a/chaosaws/msk/actions.py +++ b/chaosaws/msk/actions.py @@ -2,6 +2,7 @@ from chaoslib.types import Configuration, Secrets from chaoslib.exceptions import FailedActivity + from chaosaws import aws_client, get_logger from chaosaws.types import AWSResponse @@ -28,8 +29,8 @@ def reboot_msk_broker( ClusterArn=cluster_arn, BrokerIds=broker_ids ) - except client.exceptions.NotFoundException as e: - raise FailedActivity("The specified cluster was not found") from e + except client.exceptions.NotFoundException: + raise FailedActivity(f"The specified cluster was not found" ) def delete_cluster( @@ -44,5 +45,5 @@ def delete_cluster( logger.debug(f"Deleting MSK cluster: {cluster_arn}") try: return client.delete_cluster(ClusterArn=cluster_arn) - except client.exceptions.NotFoundException as e: - raise FailedActivity("The specified cluster was not found") from e \ No newline at end of file + except client.exceptions.NotFoundException: + raise FailedActivity(f"The specified cluster was not found") \ No newline at end of file diff --git a/chaosaws/msk/probes.py b/chaosaws/msk/probes.py index 407bc73..d1b3d7d 100644 --- a/chaosaws/msk/probes.py +++ b/chaosaws/msk/probes.py @@ -2,6 +2,7 @@ from chaoslib.types import Configuration, Secrets from chaoslib.exceptions import FailedActivity + from chaosaws import aws_client, get_logger from chaosaws.types import AWSResponse @@ -22,8 +23,8 @@ def describe_msk_cluster( logger.debug(f"Describing MSK cluster: {cluster_arn}") try: return client.describe_cluster(ClusterArn=cluster_arn) - except client.exceptions.NotFoundException as e: - raise FailedActivity("The specified cluster was not found") from e + except client.exceptions.NotFoundException: + raise FailedActivity("The specified cluster was not found") def get_bootstrap_servers( @@ -39,5 +40,5 @@ def get_bootstrap_servers( try: response = client.get_bootstrap_brokers(ClusterArn=cluster_arn) return response["BootstrapBrokerString"].split(",") if response else [] - except client.exceptions.NotFoundException as e: - raise FailedActivity("The specified cluster was not found") from e + except client.exceptions.NotFoundException: + raise FailedActivity("The specified cluster was not found")