mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-06-02 22:39:09 -07:00
Added conditional to only collect qmpstatus on qemu VMs (#4816)
* 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
This commit is contained in:
parent
dd24c98fe5
commit
71745b8024
3 changed files with 105 additions and 7 deletions
|
@ -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))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue