Skip to content
Snippets Groups Projects
Commit 8745ef8d authored by Anael Beutot's avatar Anael Beutot
Browse files

Update libvirt related tags when libvirt connection state changes.

parent c7abd77f
No related branches found
No related tags found
No related merge requests found
......@@ -45,7 +45,9 @@ class Handler(HostHandler):
def virt_connected(self, value):
self._virt_connected = value
# update tags
for tag in ('vir_status', 'hvver', 'libvirtver'):
for tag in ('vir_status', 'sto', 'nvm', 'vmpaused', 'vmstarted',
'vmstopped', 'hvver', 'libvirtver', 'hv'):
# TODO tag annoucement
self.tag_db['__main__'][tag].calculate_value()
def start(self):
......@@ -287,6 +289,11 @@ class Hypervisor(object):
state)
vm.state = state
# update domain state counts
for tag in ('nvm', 'vmpaused', 'vmstarted', 'vmstopped'):
# TODO tag announcement
self.handler.tag_db['__main__'][tag].calculate_value()
def vm_define(self, xml_desc):
"""Create a VM on the Hypervisor
:param str xml_desc: XML description in libvirt format
......
......@@ -63,6 +63,7 @@ class VirtualMachine(object):
@state.setter
def state(self, value):
self._state = value
# TODO tag announcement
self.tags['status'].value = value
@property
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment