Skip to content

Commit

Permalink
first corrections Pull Request
Browse files Browse the repository at this point in the history
Signed-off-by: Jorge Tapicha <jitapichab@gmail.com>
  • Loading branch information
jitapichab committed May 31, 2024
1 parent cae858c commit 9b460dd
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 10 deletions.
4 changes: 2 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
9 changes: 5 additions & 4 deletions chaosaws/msk/actions.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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(
Expand All @@ -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
except client.exceptions.NotFoundException:
raise FailedActivity(f"The specified cluster was not found")
9 changes: 5 additions & 4 deletions chaosaws/msk/probes.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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(
Expand All @@ -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")

0 comments on commit 9b460dd

Please sign in to comment.