From e1d550b437f4de3705d97d9b752838ce89613000 Mon Sep 17 00:00:00 2001 From: Joshua Boniface Date: Mon, 18 Jun 2018 00:51:22 -0400 Subject: [PATCH] Fix bug where dom was Nonetype --- pvcd/VMInstance.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/pvcd/VMInstance.py b/pvcd/VMInstance.py index f2b9ba70..1d0840bd 100644 --- a/pvcd/VMInstance.py +++ b/pvcd/VMInstance.py @@ -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')