Fix bug where dom was Nonetype

This commit is contained in:
Joshua Boniface 2018-06-18 00:51:22 -04:00
parent e48409b96a
commit e1d550b437
1 changed files with 6 additions and 1 deletions

View File

@ -250,7 +250,12 @@ class VMInstance:
except:
continue
if self.dom.state()[0] == libvirt.VIR_DOMAIN_RUNNING:
try:
dom_state = self.dom.state()[0]
except AttributeError:
dom_state = None
if dom_state == libvirt.VIR_DOMAIN_RUNNING:
if not self.domuuid in self.thishypervisor.domain_list:
self.thishypervisor.domain_list.append(self.domuuid)
ansiiprint.echo('Successfully received migrated VM', '{}:'.format(self.domuuid), 'o')