Fix the handling a bit

This commit is contained in:
Joshua Boniface 2018-06-02 00:35:49 -04:00
parent 5a0cd65561
commit 6e8bfd5741
1 changed files with 4 additions and 2 deletions

View File

@ -34,9 +34,11 @@ class VMInstance:
print("Starting VM %s" % self.domuuid)
try:
dom = conn.createXML(xmlconfig, 0)
except libvirt.libvirtError:
self.zk.set(self.zkey + '/status', 'stop'.encode('ascii'))
except:
print('Failed to create domain %s' % self.domuuid)
if dom == None:
self.zk.set(self.zkey + '/status', 'stop'.encode('ascii'))
return None
if not self.domuuid in self.thishypervisor.domain_list: