Skip to content

Commit 9b460dd

Browse files
committed
first corrections Pull Request
Signed-off-by: Jorge Tapicha <[email protected]>
1 parent cae858c commit 9b460dd

File tree

3 files changed

+12
-10
lines changed

3 files changed

+12
-10
lines changed

CHANGELOG.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
# Changelog
22

3+
## [Unreleased][]
4+
35
### Added
46

57
* MSK probes `chaosaws.msk.probes.describe_msk_cluster` `chaosaws.msk.probes.get_bootstrap_servers`
68
* MSK actions `chaosaws.msk.actions.reboot_msk_broker` `chaosaws.msk.actions.delete_cluster`
79

8-
## [Unreleased][]
9-
1010
[Unreleased]: https://github.com/chaostoolkit-incubator/chaostoolkit-aws/compare/0.33.0...HEAD
1111

1212
## [0.33.0][] - 2024-02-26

chaosaws/msk/actions.py

+5-4
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
from chaoslib.types import Configuration, Secrets
44
from chaoslib.exceptions import FailedActivity
5+
56
from chaosaws import aws_client, get_logger
67
from chaosaws.types import AWSResponse
78

@@ -28,8 +29,8 @@ def reboot_msk_broker(
2829
ClusterArn=cluster_arn,
2930
BrokerIds=broker_ids
3031
)
31-
except client.exceptions.NotFoundException as e:
32-
raise FailedActivity("The specified cluster was not found") from e
32+
except client.exceptions.NotFoundException:
33+
raise FailedActivity(f"The specified cluster was not found" )
3334

3435

3536
def delete_cluster(
@@ -44,5 +45,5 @@ def delete_cluster(
4445
logger.debug(f"Deleting MSK cluster: {cluster_arn}")
4546
try:
4647
return client.delete_cluster(ClusterArn=cluster_arn)
47-
except client.exceptions.NotFoundException as e:
48-
raise FailedActivity("The specified cluster was not found") from e
48+
except client.exceptions.NotFoundException:
49+
raise FailedActivity(f"The specified cluster was not found")

chaosaws/msk/probes.py

+5-4
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
from chaoslib.types import Configuration, Secrets
44
from chaoslib.exceptions import FailedActivity
5+
56
from chaosaws import aws_client, get_logger
67
from chaosaws.types import AWSResponse
78

@@ -22,8 +23,8 @@ def describe_msk_cluster(
2223
logger.debug(f"Describing MSK cluster: {cluster_arn}")
2324
try:
2425
return client.describe_cluster(ClusterArn=cluster_arn)
25-
except client.exceptions.NotFoundException as e:
26-
raise FailedActivity("The specified cluster was not found") from e
26+
except client.exceptions.NotFoundException:
27+
raise FailedActivity("The specified cluster was not found")
2728

2829

2930
def get_bootstrap_servers(
@@ -39,5 +40,5 @@ def get_bootstrap_servers(
3940
try:
4041
response = client.get_bootstrap_brokers(ClusterArn=cluster_arn)
4142
return response["BootstrapBrokerString"].split(",") if response else []
42-
except client.exceptions.NotFoundException as e:
43-
raise FailedActivity("The specified cluster was not found") from e
43+
except client.exceptions.NotFoundException:
44+
raise FailedActivity("The specified cluster was not found")

0 commit comments

Comments
 (0)