From df4f80cfb1f8c6587ce7190c156c0f54bcbc77e9 Mon Sep 17 00:00:00 2001 From: Joshua Boniface Date: Mon, 4 Jun 2018 16:30:09 -0400 Subject: [PATCH] Remove all the remaining previous_hypervisor cruft --- VMInstance.py | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) diff --git a/VMInstance.py b/VMInstance.py index e80ebd37..9595180e 100644 --- a/VMInstance.py +++ b/VMInstance.py @@ -135,17 +135,13 @@ class VMInstance: # Migrate the VM to a target host def migrate_vm(self): self.inmigrate = True - this_hypervisor = self.thishypervisor.name - new_hypervisor = self.hypervisor - previous_hypervisor = self.zk.get(self.zkey + '/formerhypervisor')[0].decode('ascii') - print('>>> %s - Migrating VM to %s' % (self.domuuid, new_hypervisor)) - migrate_ret = self.live_migrate_vm(new_hypervisor) + print('>>> %s - Migrating VM to %s' % (self.domuuid, self.hypervisor)) + migrate_ret = self.live_migrate_vm(self.hypervisor) if migrate_ret != 0: - print('>>> %s - Could not live migrate VM; forcing away uncleanly' % self.domuuid) - self.stop_vm() + print('>>> %s - Could not live migrate VM; forcing away' % self.domuuid) + self.shutdown_vm() time.sleep(0.5) - return else: try: self.thishypervisor.domain_list.remove(self.domuuid) @@ -171,11 +167,6 @@ class VMInstance: if not self.domuuid in self.thishypervisor.domain_list: self.thishypervisor.domain_list.append(self.domuuid) - # Reset the former_hypervisor key - former_hypervisor = self.zk.get(self.zkey + '/formerhypervisor') - if former_hypervisor == self.thishypervisor.name: - self.zk.set(self.zkey + '/formerhypervisor', ''.encode('ascii')) - print('>>> %s - Migrated successfully' % self.domuuid) self.inreceive = False