-
Notifications
You must be signed in to change notification settings - Fork 29
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
Develop: Rebase for OCP resource cleanup on AWS #137
base: develop
Are you sure you want to change the base?
Conversation
bb819b6
to
30d9792
Compare
30d9792
to
efbdc4f
Compare
@@ -11,27 +11,44 @@ | |||
def cleanup(**kwargs): | |||
is_dry_run = kwargs.get("dry_run", False) |
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.
I know it's not related, but don't we want to set dry_run
to true by default?
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.
For making it dummy proof
awscleanup.ocps.cleanup() | ||
if is_dry_run: | ||
echo_dry(dry_data) | ||
else: |
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.
Might not want to use else
since the cleanup can be set to execute OCPs and other resources as well (or use kwargs["_all"]
)
# VMsContainer = namedtuple('VMsCotainer', ['delete', 'stop', 'skip']) | ||
# return VMsContainer(self._delete, self._stop, self._skip) |
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.
Seems like a leftover :)
# VMsContainer = namedtuple('VMsCotainer', ['delete', 'stop', 'skip']) | |
# return VMsContainer(self._delete, self._stop, self._skip) |
if is_dry_run: | ||
echo_dry(dry_data) |
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.
Following the last comment, since the cleanup can be executed on multiple resources (OCPs and others), I think the if is_dry_run:
component should be outside both sections and appear once only, post all resources cleanup executions.
if is_dry_run: | |
echo_dry(dry_data) | |
if is_dry_run: | |
echo_dry(dry_data) |
Will take a look on the comments tomorrow in brief but did you see any logical failures via static check or execution ? |
Other than the "else" I noted (will break any cleanup contains with both OCPs and other types of AWS resources); The only thing I suscpected is here, needs to be approachable in any case. I thought it maybe should be |
Rebasing #134 with Develop branch.