-
Notifications
You must be signed in to change notification settings - Fork 102
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
Add destroy units #812
Add destroy units #812
Conversation
for u in unit_names: | ||
await self.destroy_unit(u, destroy_storage, dry_run, force, max_wait) |
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.
you can do this or this:
for u in unit_names: | |
await self.destroy_unit(u, destroy_storage, dry_run, force, max_wait) | |
await jasyncio.gather(*( | |
self.destroy_unit(u, destroy_storage, dry_run, force, max_wait) | |
for u in unit_names | |
)) |
While I believe your proposed solution here would get the job done, it may be quicker to not issue the Destroy sequentially. I don't know how long it actually takes to actually start one destroy_unit
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.
Unless it makes things significantly slower, I'd prefer to depend on asyncio as little as possible as we ultimately want to get rid of it. I didn't observe such performance deficit when I was running the tests, but feel free to run a comparison on it if you're curious 👍
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 it's totally your call here! thanks for the PR. LGTM
Test unit annotations is failing |
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.
LG2M
That failing test |
/merge |
Description
This brings back the separate
model.destroy_units(*units)
as a quality of life feature.Fixes #811
QA Steps
All the regular tests should pass. Additionally, this also adds a separate integration test for
destroy_units
, so the following should be passing (I tried it on juju 3.1).Notes & Discussion
As a future reference, this was changed in #791.