From 5a0cd65561ff2e8259d1f52a1de9b49188cd7407 Mon Sep 17 00:00:00 2001 From: Joshua Boniface Date: Sat, 2 Jun 2018 00:33:54 -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 b315ad4e..00b5c2e5 100644 --- a/VMInstance.py +++ b/VMInstance.py @@ -35,11 +35,13 @@ class VMInstance: try: dom = conn.createXML(xmlconfig, 0) except libvirt.libvirtError: - print('Failed to create domain %s' % self.domuuid) self.zk.set(self.zkey + '/status', 'stop'.encode('ascii')) - exit(1) + print('Failed to create domain %s' % self.domuuid) + return None + if not self.domuuid in self.thishypervisor.domain_list: self.thishypervisor.domain_list.append(self.domuuid) + return dom # Stop the VM forcibly