-
Notifications
You must be signed in to change notification settings - Fork 52
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
Fix virt.full_info #176
Merged
brejoc
merged 2 commits into
openSUSE:openSUSE-2019.2.0
from
cbosdo:openSUSE-2019.2.0-pr54335
Sep 3, 2019
Merged
Fix virt.full_info #176
brejoc
merged 2 commits into
openSUSE:openSUSE-2019.2.0
from
cbosdo:openSUSE-2019.2.0-pr54335
Sep 3, 2019
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
In some places in the virt module, the get_xml function was called with a domain object, leading to runtime errors like the following one: 'ERROR: The VM "<libvirt.virDomain object at 0x7fad04208650>" is not present'
When getting VM disks informations on a running VM, the following error occured: The minion function caused an exception: Traceback (most recent call last): File "/usr/lib/python3.6/site-packages/salt/minion.py", line 1673, in _thread_return return_data = minion_instance.executors[fname](opts, data, func, args, kwargs) File "/usr/lib/python3.6/site-packages/salt/executors/direct_call.py", line 12, in execute return func(*args, **kwargs) File "/usr/lib/python3.6/site-packages/salt/modules/virt.py", line 2411, in full_info 'vm_info': vm_info()} File "/usr/lib/python3.6/site-packages/salt/modules/virt.py", line 2020, in vm_info info[domain.name()] = _info(domain) File "/usr/lib/python3.6/site-packages/salt/modules/virt.py", line 2004, in _info 'disks': _get_disks(dom), File "/usr/lib/python3.6/site-packages/salt/modules/virt.py", line 465, in _get_disks output = _parse_qemu_img_info(qemu_output) File "/usr/lib/python3.6/site-packages/salt/modules/virt.py", line 287, in _parse_qemu_img_info raw_infos = salt.utils.json.loads(info) File "/usr/lib/python3.6/site-packages/salt/utils/json.py", line 92, in loads return json_module.loads(s, **kwargs) File "/usr/lib64/python3.6/json/__init__.py", line 354, in loads return _default_decoder.decode(s) File "/usr/lib64/python3.6/json/decoder.py", line 339, in decode obj, end = self.raw_decode(s, idx=_w(s, 0).end()) File "/usr/lib64/python3.6/json/decoder.py", line 357, in raw_decode raise JSONDecodeError("Expecting value", s, err.value) from None json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0) This is due to the fact that qemu-img can't get infos on a disk that is already used like by a running VM. Using the qemu-img -U flag gets it running in all cases.
meaksh
pushed a commit
that referenced
this pull request
Oct 1, 2019
* virt.get_xml doesn't take a domain object In some places in the virt module, the get_xml function was called with a domain object, leading to runtime errors like the following one: 'ERROR: The VM "<libvirt.virDomain object at 0x7fad04208650>" is not present' * qemu-img info needs -U flag on running VMs When getting VM disks informations on a running VM, the following error occured: The minion function caused an exception: Traceback (most recent call last): File "/usr/lib/python3.6/site-packages/salt/minion.py", line 1673, in _thread_return return_data = minion_instance.executors[fname](opts, data, func, args, kwargs) File "/usr/lib/python3.6/site-packages/salt/executors/direct_call.py", line 12, in execute return func(*args, **kwargs) File "/usr/lib/python3.6/site-packages/salt/modules/virt.py", line 2411, in full_info 'vm_info': vm_info()} File "/usr/lib/python3.6/site-packages/salt/modules/virt.py", line 2020, in vm_info info[domain.name()] = _info(domain) File "/usr/lib/python3.6/site-packages/salt/modules/virt.py", line 2004, in _info 'disks': _get_disks(dom), File "/usr/lib/python3.6/site-packages/salt/modules/virt.py", line 465, in _get_disks output = _parse_qemu_img_info(qemu_output) File "/usr/lib/python3.6/site-packages/salt/modules/virt.py", line 287, in _parse_qemu_img_info raw_infos = salt.utils.json.loads(info) File "/usr/lib/python3.6/site-packages/salt/utils/json.py", line 92, in loads return json_module.loads(s, **kwargs) File "/usr/lib64/python3.6/json/__init__.py", line 354, in loads return _default_decoder.decode(s) File "/usr/lib64/python3.6/json/decoder.py", line 339, in decode obj, end = self.raw_decode(s, idx=_w(s, 0).end()) File "/usr/lib64/python3.6/json/decoder.py", line 357, in raw_decode raise JSONDecodeError("Expecting value", s, err.value) from None json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0) This is due to the fact that qemu-img can't get infos on a disk that is already used like by a running VM. Using the qemu-img -U flag gets it running in all cases.
brejoc
pushed a commit
that referenced
this pull request
Nov 15, 2019
* virt.get_xml doesn't take a domain object In some places in the virt module, the get_xml function was called with a domain object, leading to runtime errors like the following one: 'ERROR: The VM "<libvirt.virDomain object at 0x7fad04208650>" is not present' * qemu-img info needs -U flag on running VMs When getting VM disks informations on a running VM, the following error occured: The minion function caused an exception: Traceback (most recent call last): File "/usr/lib/python3.6/site-packages/salt/minion.py", line 1673, in _thread_return return_data = minion_instance.executors[fname](opts, data, func, args, kwargs) File "/usr/lib/python3.6/site-packages/salt/executors/direct_call.py", line 12, in execute return func(*args, **kwargs) File "/usr/lib/python3.6/site-packages/salt/modules/virt.py", line 2411, in full_info 'vm_info': vm_info()} File "/usr/lib/python3.6/site-packages/salt/modules/virt.py", line 2020, in vm_info info[domain.name()] = _info(domain) File "/usr/lib/python3.6/site-packages/salt/modules/virt.py", line 2004, in _info 'disks': _get_disks(dom), File "/usr/lib/python3.6/site-packages/salt/modules/virt.py", line 465, in _get_disks output = _parse_qemu_img_info(qemu_output) File "/usr/lib/python3.6/site-packages/salt/modules/virt.py", line 287, in _parse_qemu_img_info raw_infos = salt.utils.json.loads(info) File "/usr/lib/python3.6/site-packages/salt/utils/json.py", line 92, in loads return json_module.loads(s, **kwargs) File "/usr/lib64/python3.6/json/__init__.py", line 354, in loads return _default_decoder.decode(s) File "/usr/lib64/python3.6/json/decoder.py", line 339, in decode obj, end = self.raw_decode(s, idx=_w(s, 0).end()) File "/usr/lib64/python3.6/json/decoder.py", line 357, in raw_decode raise JSONDecodeError("Expecting value", s, err.value) from None json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0) This is due to the fact that qemu-img can't get infos on a disk that is already used like by a running VM. Using the qemu-img -U flag gets it running in all cases.
dincamihai
pushed a commit
that referenced
this pull request
Nov 19, 2019
* virt.get_xml doesn't take a domain object In some places in the virt module, the get_xml function was called with a domain object, leading to runtime errors like the following one: 'ERROR: The VM "<libvirt.virDomain object at 0x7fad04208650>" is not present' * qemu-img info needs -U flag on running VMs When getting VM disks informations on a running VM, the following error occured: The minion function caused an exception: Traceback (most recent call last): File "/usr/lib/python3.6/site-packages/salt/minion.py", line 1673, in _thread_return return_data = minion_instance.executors[fname](opts, data, func, args, kwargs) File "/usr/lib/python3.6/site-packages/salt/executors/direct_call.py", line 12, in execute return func(*args, **kwargs) File "/usr/lib/python3.6/site-packages/salt/modules/virt.py", line 2411, in full_info 'vm_info': vm_info()} File "/usr/lib/python3.6/site-packages/salt/modules/virt.py", line 2020, in vm_info info[domain.name()] = _info(domain) File "/usr/lib/python3.6/site-packages/salt/modules/virt.py", line 2004, in _info 'disks': _get_disks(dom), File "/usr/lib/python3.6/site-packages/salt/modules/virt.py", line 465, in _get_disks output = _parse_qemu_img_info(qemu_output) File "/usr/lib/python3.6/site-packages/salt/modules/virt.py", line 287, in _parse_qemu_img_info raw_infos = salt.utils.json.loads(info) File "/usr/lib/python3.6/site-packages/salt/utils/json.py", line 92, in loads return json_module.loads(s, **kwargs) File "/usr/lib64/python3.6/json/__init__.py", line 354, in loads return _default_decoder.decode(s) File "/usr/lib64/python3.6/json/decoder.py", line 339, in decode obj, end = self.raw_decode(s, idx=_w(s, 0).end()) File "/usr/lib64/python3.6/json/decoder.py", line 357, in raw_decode raise JSONDecodeError("Expecting value", s, err.value) from None json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0) This is due to the fact that qemu-img can't get infos on a disk that is already used like by a running VM. Using the qemu-img -U flag gets it running in all cases.
brejoc
pushed a commit
that referenced
this pull request
Jan 31, 2020
* virt.get_xml doesn't take a domain object In some places in the virt module, the get_xml function was called with a domain object, leading to runtime errors like the following one: 'ERROR: The VM "<libvirt.virDomain object at 0x7fad04208650>" is not present' * qemu-img info needs -U flag on running VMs When getting VM disks informations on a running VM, the following error occured: The minion function caused an exception: Traceback (most recent call last): File "/usr/lib/python3.6/site-packages/salt/minion.py", line 1673, in _thread_return return_data = minion_instance.executors[fname](opts, data, func, args, kwargs) File "/usr/lib/python3.6/site-packages/salt/executors/direct_call.py", line 12, in execute return func(*args, **kwargs) File "/usr/lib/python3.6/site-packages/salt/modules/virt.py", line 2411, in full_info 'vm_info': vm_info()} File "/usr/lib/python3.6/site-packages/salt/modules/virt.py", line 2020, in vm_info info[domain.name()] = _info(domain) File "/usr/lib/python3.6/site-packages/salt/modules/virt.py", line 2004, in _info 'disks': _get_disks(dom), File "/usr/lib/python3.6/site-packages/salt/modules/virt.py", line 465, in _get_disks output = _parse_qemu_img_info(qemu_output) File "/usr/lib/python3.6/site-packages/salt/modules/virt.py", line 287, in _parse_qemu_img_info raw_infos = salt.utils.json.loads(info) File "/usr/lib/python3.6/site-packages/salt/utils/json.py", line 92, in loads return json_module.loads(s, **kwargs) File "/usr/lib64/python3.6/json/__init__.py", line 354, in loads return _default_decoder.decode(s) File "/usr/lib64/python3.6/json/decoder.py", line 339, in decode obj, end = self.raw_decode(s, idx=_w(s, 0).end()) File "/usr/lib64/python3.6/json/decoder.py", line 357, in raw_decode raise JSONDecodeError("Expecting value", s, err.value) from None json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0) This is due to the fact that qemu-img can't get infos on a disk that is already used like by a running VM. Using the qemu-img -U flag gets it running in all cases.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What does this PR do?
While running
virt.full_info
module function, several errors happened:and
This PR fixes both of these issues.
What issues does this PR fix or reference?
This is a backport of saltstack/salt#54335
Fixes bsc#1146382