From c16eb86456a043aa7de3734e2f8eba1429f28454 Mon Sep 17 00:00:00 2001 From: Joshua Boniface Date: Tue, 12 Jun 2018 22:00:23 -0400 Subject: [PATCH] Undo some bugfixes --- NodeInstance.py | 1 - VMInstance.py | 8 ++++---- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/NodeInstance.py b/NodeInstance.py index 2d10efc5..1df8e086 100644 --- a/NodeInstance.py +++ b/NodeInstance.py @@ -145,7 +145,6 @@ class NodeInstance(): most_memfree = memfree target_hypervisor = hypervisor - print('{} {}'.format(dom_uuid, target_hypervisor)) if target_hypervisor == None: ansiiprint.echo('Failed to find migration target for VM "{}"; shutting down'.format(dom_uuid), '', 'e') transaction = self.zk.transaction() diff --git a/VMInstance.py b/VMInstance.py index db7a84e4..eb46070c 100644 --- a/VMInstance.py +++ b/VMInstance.py @@ -252,11 +252,11 @@ class VMInstance: return 0 # VM should be stopped - if running == libvirt.VIR_DOMAIN_RUNNING and self.state == "stop" and self.hypervisor == self.thishypervisor.name and self.dom != None: + if running == libvirt.VIR_DOMAIN_RUNNING and self.state == "stop" and self.hypervisor == self.thishypervisor.name: self.stop_vm() # VM should be shut down - elif running == libvirt.VIR_DOMAIN_RUNNING and self.state == "shutdown" and self.hypervisor == self.thishypervisor.name and self.dom != None: + elif running == libvirt.VIR_DOMAIN_RUNNING and self.state == "shutdown" and self.hypervisor == self.thishypervisor.name: self.shutdown_vm() # VM should be migrated to this hypervisor @@ -264,11 +264,11 @@ class VMInstance: self.receive_migrate() # VM should be migrated away from this hypervisor - elif running == libvirt.VIR_DOMAIN_RUNNING and self.state == "migrate" and self.hypervisor != self.thishypervisor.name and self.dom != None: + elif running == libvirt.VIR_DOMAIN_RUNNING and self.state == "migrate" and self.hypervisor != self.thishypervisor.name: self.migrate_vm() # VM should be running but not on this hypervisor - elif running == libvirt.VIR_DOMAIN_RUNNING and self.state != "migrate" and self.hypervisor != self.thishypervisor.name and self.dom != None: + elif running == libvirt.VIR_DOMAIN_RUNNING and self.state != "migrate" and self.hypervisor != self.thishypervisor.name: self.terminate_vm() # VM is already running and should be