Skip to content

chore: update contact information in README.md #58

chore: update contact information in README.md

chore: update contact information in README.md #58

GitHub Actions / Black failed Jun 27, 2024 in 0s

4 errors

Black found 4 errors

Annotations

Check failure on line 39 in /home/runner/work/aws-toolbox/aws-toolbox/ec2/delete_tagged_security_groups.py

See this annotation in the file changed.

@github-actions github-actions / Black

/home/runner/work/aws-toolbox/aws-toolbox/ec2/delete_tagged_security_groups.py#L23-L39

 
 def revoke_permissions(ec2_client, group_id, permissions):
     for sg in permissions:
         if sg.get("IpPermissions", []):
             for rule in sg.get("IpPermissions", []):
-                ec2_client.revoke_security_group_ingress(GroupId=group_id, IpPermissions=[rule])
-                print("Revoked ingress IP permissions for Security Group ID: {}".format(group_id))
+                ec2_client.revoke_security_group_ingress(
+                    GroupId=group_id, IpPermissions=[rule]
+                )
+                print(
+                    "Revoked ingress IP permissions for Security Group ID: {}".format(
+                        group_id
+                    )
+                )
         if sg.get("IpPermissionsEgress", []):
             for rule in sg.get("IpPermissionsEgress", []):
-                ec2_client.revoke_security_group_egress(GroupId=group_id, IpPermissions=[rule])
-                print("Revoked egress IP permissions for Security Group ID: {}".format(group_id))
+                ec2_client.revoke_security_group_egress(
+                    GroupId=group_id, IpPermissions=[rule]
+                )
+                print(
+                    "Revoked egress IP permissions for Security Group ID: {}".format(
+                        group_id
+                    )
+                )
 
 
 def delete_security_group(ec2_client, group_id):
     ec2_client.delete_security_group(GroupId=group_id)
     print("Deleted Security Group ID: {}".format(group_id))

Check failure on line 68 in /home/runner/work/aws-toolbox/aws-toolbox/ec2/delete_tagged_security_groups.py

See this annotation in the file changed.

@github-actions github-actions / Black

/home/runner/work/aws-toolbox/aws-toolbox/ec2/delete_tagged_security_groups.py#L48-L68

     # Modify the tag key and value to your own liking
     tag_key = "ManagedByAmazonSageMakerResource"
     tag_value_contains = f"arn:aws:sagemaker:{aws_region}:{account_id}:domain"
 
     # Find security groups
-    tagged_security_groups = find_security_groups(ec2_client, tag_key, tag_value_contains)
+    tagged_security_groups = find_security_groups(
+        ec2_client, tag_key, tag_value_contains
+    )
 
     # Iterate through security groups, revoke permissions, and delete
     for sg in tagged_security_groups:
         group_id = sg["GroupId"]
 
         # Fetch the current ingress and egress IP permissions
-        sg = ec2_client.describe_security_groups(Filters=[{"Name": "group-id", "Values": [group_id]}]).get(
-            "SecurityGroups", []
-        )
+        sg = ec2_client.describe_security_groups(
+            Filters=[{"Name": "group-id", "Values": [group_id]}]
+        ).get("SecurityGroups", [])
 
         # Revoke permissions
         revoke_permissions(ec2_client, group_id, sg)
 
         # Delete the security group

Check failure on line 49 in /home/runner/work/aws-toolbox/aws-toolbox/efs/delete_tagged_efs.py

See this annotation in the file changed.

@github-actions github-actions / Black

/home/runner/work/aws-toolbox/aws-toolbox/efs/delete_tagged_efs.py#L38-L49

             # Delete the mount targets for the EFS filesystem
             delete_mount_targets(efs_client, filesystem_id)
 
             # Wait with exponential backoff
             delay = (2**current_retry) + random.uniform(0, 1)
-            print(f"Waiting for {delay} seconds before attempting to delete the EFS filesystem.")
+            print(
+                f"Waiting for {delay} seconds before attempting to delete the EFS filesystem."
+            )
             time.sleep(delay)
 
             # Delete the specified EFS filesystem
             efs_client.delete_file_system(FileSystemId=filesystem_id)
             print("Deleted EFS Filesystem: {}".format(filesystem_id))

Check failure on line 46 in /home/runner/work/aws-toolbox/aws-toolbox/ecs/delete_all_inactive_task_definitions.py

See this annotation in the file changed.

@github-actions github-actions / Black

/home/runner/work/aws-toolbox/aws-toolbox/ecs/delete_all_inactive_task_definitions.py#L27-L46

             client.delete_task_definitions(taskDefinitions=[arn])
             print(f"Deleted task definition {arn}")
             break  # Break the loop if deletion was successful
         except client.exceptions.ClientException as e:
             if "Throttling" in str(e):  # Check for throttling in the error message
-                print(f"Throttling exception when deleting {arn}: {e}, retrying in {backoff} seconds...")
+                print(
+                    f"Throttling exception when deleting {arn}: {e}, retrying in {backoff} seconds..."
+                )
                 time.sleep(backoff)
                 backoff *= 2  # Exponential backoff
             else:
                 print(f"Client exception when deleting task definition {arn}: {e}")
                 break  # Break the loop for other client exceptions
         except client.exceptions.ServerException as e:
             if "Throttling" in str(e):  # Check for throttling in the error message
-                print(f"Throttling exception when deleting {arn}: {e}, retrying in {backoff} seconds...")
+                print(
+                    f"Throttling exception when deleting {arn}: {e}, retrying in {backoff} seconds..."
+                )
                 time.sleep(backoff)
                 backoff *= 2  # Exponential backoff
             else:
                 print(f"Server exception when deleting task definition {arn}: {e}")
                 break  # Break the loop for other server exceptions