Added conditional to only collect qmpstatus on qemu VMs (#4816) (#4817)

* Added conditional to only collect qmpstatus on qemu VMs

* Processed feedback, added changelog

* Initial change to unit tests

* Made Sanity tests happy again

* Missed a function call, removed superfluous function

* Derp, no need to mock get_vm_status anymore

* Added detail checks whether hosts are mapped to the paused/prelaunch groups

* Fix sanity check

* Processed feedback

* Processed feedback - noqa

(cherry picked from commit 71745b8024)

Co-authored-by: Jeffrey van Pelt <jeff@vanpelt.one>
This commit is contained in:
patchback[bot] 2022-06-11 13:55:15 +02:00 committed by GitHub
parent c44298c437
commit f8d35eeb14
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 105 additions and 7 deletions

View file

@ -443,7 +443,8 @@ class InventoryModule(BaseInventoryPlugin, Constructable, Cacheable):
def _get_vm_status(self, properties, node, vmid, vmtype, name):
ret = self._get_json("%s/api2/json/nodes/%s/%s/%s/status/current" % (self.proxmox_url, node, vmtype, vmid))
properties[self._fact('status')] = ret['status']
properties[self._fact('qmpstatus')] = ret['qmpstatus']
if vmtype == 'qemu':
properties[self._fact('qmpstatus')] = ret['qmpstatus']
def _get_vm_snapshots(self, properties, node, vmid, vmtype, name):
ret = self._get_json("%s/api2/json/nodes/%s/%s/%s/snapshot" % (self.proxmox_url, node, vmtype, vmid))