Skip to content

Commit

Permalink
Altered log levels as some dont need to be error
Browse files Browse the repository at this point in the history
  • Loading branch information
jamesstottmoj committed Jan 16, 2025
1 parent ec66f86 commit 70eb137
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions controlpanel/api/aws.py
Original file line number Diff line number Diff line change
Expand Up @@ -1465,7 +1465,8 @@ def get_user_id(self, user_email):
)

return response["UserId"]
except self.client.exceptions.ResourceNotFoundException:
except self.client.exceptions.ResourceNotFoundException as error:
log.info(error.response["Error"]["Message"])
return None

def get_group_id(self, group_name):
Expand Down Expand Up @@ -1498,7 +1499,7 @@ def get_group_membership_id(self, group_name, user_email):

return response["MembershipId"]
except self.client.exceptions.ResourceNotFoundException as error:
log.error(error.response["Error"]["Message"])
log.info(error.response["Error"]["Message"])
return None

def get_name_from_email(self, user_email):
Expand Down Expand Up @@ -1554,7 +1555,7 @@ def create_group_membership(self, user_email, group_name):
membership_id = self.get_group_membership_id(group_name, user_email)

if membership_id is not None:
log.debug("User is already a member of this group. Skipping")
log.info("User is already a member of this group. Skipping")
return

response = self.client.create_group_membership(
Expand All @@ -1577,7 +1578,7 @@ def delete_group_membership(self, user_email, group_name):
membership_id = self.get_group_membership_id(group_name, user_email)

if membership_id is None:
log.debug("User is not a member of this group. Skipping")
log.info("User is not a member of this group. Skipping")
return

self.client.delete_group_membership(
Expand Down

0 comments on commit 70eb137

Please sign in to comment.