From 6e8bfd5741078006d2ba4cc4b06d51cf515c9dd8 Mon Sep 17 00:00:00 2001 From: Joshua Boniface Date: Sat, 2 Jun 2018 00:35:49 -0400 Subject: [PATCH] Fix the handling a bit --- VMInstance.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/VMInstance.py b/VMInstance.py index 00b5c2e5..bb5c35ac 100644 --- a/VMInstance.py +++ b/VMInstance.py @@ -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: