-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
virt._get_domain: don't raise an exception if there is no VM #56392
Conversation
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.
👍
@saltstack/team-core Would be cool if we might get a go nor no-go here from you. Then we could still squeeze this into the next SLE release. Thanks and sorry for pushing! |
just rebased on top of master |
rebased on master |
Thank you for PR! It's perfect. Lets wait for tests. |
@cbosdo could you please resolve merge conflicts? |
@DmitryKuzmenko rebased |
c47ba77
to
da7a380
Compare
Raising an exception if there is no VM in _get_domain makes sense if looking for some VMs, but not when listing all VMs.
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've slightly updated the test (isort and "/' in check string). Now it should be ready. Lets wait for tests.
@DmitryKuzmenko I've seen that isort and black are sometimes doing conflicting changes... which to believe then? |
@cbosdo this is a good point but I haven't seen such behavior. Do you have an example? |
As an example in PR #55814, running --- a/salt/states/virt.py
+++ b/salt/states/virt.py
@@ -25,7 +25,6 @@ import salt.utils.files
import salt.utils.stringutils
import salt.utils.versions
from salt.exceptions import CommandExecutionError
-
# Import 3rd-party libs
from salt.ext import six
Applying |
@cbosdo Hah! Really works if run isort and black manually but pre-commit hook doesn't do any change on that file. |
yeah it depends on the run order of isort and black |
Less the run order, and more the version. When isort 5 is released it will contain the black friendly option to put spaces before comments. |
If you run |
OK, will try for my next commits :) |
What does this PR do?
Raising an exception if there is no VM in
virt._get_domain
makes sense iflooking for some VMs, but not when listing all VMs.
What issues does this PR fix or reference?
Previous Behavior
Running this on a hypervisor minion without any VM raises an exception:
New Behavior
Running the same command without any VM only returns an empty list
Tests written?
Yes
Commits signed with GPG?
Yes
Please review Salt's Contributing Guide for best practices.
See GitHub's page on GPG signing for more information about signing commits with GPG.