Skip to content

Commit 8cac479

Browse files
author
Justin
committed
linting fixes
1 parent 94e4b44 commit 8cac479

File tree

1 file changed

+8
-5
lines changed
  • aws_sra_examples/solutions/shield_advanced/shield_advanced/lambda/src

1 file changed

+8
-5
lines changed

aws_sra_examples/solutions/shield_advanced/shield_advanced/lambda/src/shield.py

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -242,6 +242,9 @@ def get_buckets_to_protect(account_session: boto3.Session, buckets_in_account: l
242242
243243
Returns:
244244
list of buckets
245+
246+
Raises:
247+
Error trying to get S3 buckets
245248
"""
246249
LOGGER.info("Getting all buckets")
247250
buckets: list = []
@@ -309,7 +312,7 @@ def detach_drt_role_policy(account_session: boto3.Session, role_name: str) -> No
309312

310313

311314
def delete_drt_role(account_session: boto3.Session, role_name: str) -> None:
312-
"""Deletes the IAM role used by the DRT.
315+
"""Delete the IAM role used by the DRT.
313316
314317
Args:
315318
account_session: account session
@@ -387,7 +390,7 @@ def create_drt_role(account: str, role_name: str, account_session: boto3.Session
387390
LOGGER.info(api_call_details)
388391

389392
LOGGER.info(f"finished creating DRT role for account {account}")
390-
return role_arn
393+
return role_arn # noqa R504
391394

392395

393396
def associate_drt_role(shield_client: ShieldClient, role_arn: str) -> None:
@@ -505,7 +508,7 @@ def check_proactive_engagement_enabled(shield_client: ShieldClient, params: dict
505508
if "ProactiveEngagementStatus" not in describe_subscription_response["Subscription"]:
506509
return False
507510
proactive_engagement_status: str = describe_subscription_response["Subscription"]["ProactiveEngagementStatus"]
508-
if proactive_engagement_status == "ENABLED":
511+
if proactive_engagement_status == "ENABLED": # noqa R505
509512
return True
510513
elif proactive_engagement_status == "DISABLED":
511514
return False
@@ -683,7 +686,7 @@ def enable_proactive_engagement(shield_client: ShieldClient, params: dict) -> No
683686

684687

685688
def associate_proactive_engagement_details(shield_client: ShieldClient, params: dict) -> None:
686-
"""Allow the DRT to use the contact information to reach out to the contacts
689+
"""Allow the DRT to use the contact information.
687690
688691
Args:
689692
shield_client: shield client
@@ -709,7 +712,7 @@ def disable_proactive_engagement(shield_client: ShieldClient) -> None:
709712
shield_client: Shield client
710713
711714
Raises:
712-
e: Client error
715+
e: ClientError
713716
"""
714717
try:
715718
disable_proactive_engagement_response = shield_client.disable_proactive_engagement()

0 commit comments

Comments
 (0)