-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Code Cleanup #8
Code Cleanup #8
Conversation
There was the possibllity of falling through to an unset variable previously.
Type hints should be added whenever possible. This fixes missing return value hints for two methods.
Deleting the parameter when no users are present may cause dependent tools to fail instead of performing a no-op because it is empty.
Sorting the users that are turned into a comma delimited list makes it easier for manual interaction in the AWS console. The tool should be preferred, but we should still consider other interactions.
The ManageOperators.add_user() and ManageOperators.remove_user() methods were needlessly complicated about the return value. This simplifies them since the method they are relying on for functionality returns the same type of value.
Replace all of the f-strings with the substitution based log messaging that is preferred.
Single character variable names are generally discouraged for Python.
Simply of an over-complicated check in Schema validation. Remove an unnecessary else return usage.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice improvements! 🎟️
try: | ||
# The SSM response on success currently only contains a version | ||
# number and the parameter tier. | ||
# Neither are useful to us at this time, so we don't store them.. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is the double-period intentional here? I saw another one elsewhere.
# Neither are useful to us at this time, so we don't store them.. | |
# Neither are useful to us at this time, so we don't store them. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nope, nice catch. Fixed both instances in 5b1711c.
It was pointed out in review that I had some unintentional double periods, so I have fixed them.
🗣 Description
This PR is mostly just some housekeeping for this project. There is a bug fixed in 93798d3, and a potential side-effect is removed in 28c9247, but the bulk is some general polish. The logging has also been adjusted to
printf
style that is preferred because oflogging
library internals.💭 Motivation and context
The bug I mentioned is a problem for anyone else trying to use this code in production. While I was fixing the aforementioned bug, I wanted to do some general housekeeping since this project was created before we moved to an "Initial Pull Request" model as talked about in the development guide.
🧪 Testing
Automated testing passes and some basic checks I ran locally gave expected results.
✅ Checklist