@@ -242,6 +242,9 @@ def get_buckets_to_protect(account_session: boto3.Session, buckets_in_account: l
242
242
243
243
Returns:
244
244
list of buckets
245
+
246
+ Raises:
247
+ Error trying to get S3 buckets
245
248
"""
246
249
LOGGER .info ("Getting all buckets" )
247
250
buckets : list = []
@@ -309,7 +312,7 @@ def detach_drt_role_policy(account_session: boto3.Session, role_name: str) -> No
309
312
310
313
311
314
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.
313
316
314
317
Args:
315
318
account_session: account session
@@ -387,7 +390,7 @@ def create_drt_role(account: str, role_name: str, account_session: boto3.Session
387
390
LOGGER .info (api_call_details )
388
391
389
392
LOGGER .info (f"finished creating DRT role for account { account } " )
390
- return role_arn
393
+ return role_arn # noqa R504
391
394
392
395
393
396
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
505
508
if "ProactiveEngagementStatus" not in describe_subscription_response ["Subscription" ]:
506
509
return False
507
510
proactive_engagement_status : str = describe_subscription_response ["Subscription" ]["ProactiveEngagementStatus" ]
508
- if proactive_engagement_status == "ENABLED" :
511
+ if proactive_engagement_status == "ENABLED" : # noqa R505
509
512
return True
510
513
elif proactive_engagement_status == "DISABLED" :
511
514
return False
@@ -683,7 +686,7 @@ def enable_proactive_engagement(shield_client: ShieldClient, params: dict) -> No
683
686
684
687
685
688
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.
687
690
688
691
Args:
689
692
shield_client: shield client
@@ -709,7 +712,7 @@ def disable_proactive_engagement(shield_client: ShieldClient) -> None:
709
712
shield_client: Shield client
710
713
711
714
Raises:
712
- e: Client error
715
+ e: ClientError
713
716
"""
714
717
try :
715
718
disable_proactive_engagement_response = shield_client .disable_proactive_engagement ()
0 commit comments