Add condition to avoid setting ZK status during restart shutdown/stop

This commit is contained in:
Joshua Boniface 2018-06-13 12:52:40 -04:00
parent f543c43978
commit cf6cc9ff8a
1 changed files with 6 additions and 2 deletions

View File

@ -143,7 +143,9 @@ class VMInstance:
except ValueError:
pass
if self.inrestart == False:
self.zk.set('/domains/{}/state'.format(self.domuuid), 'stop'.encode('ascii'))
ansiiprint.echo('Successfully stopped VM', '{}:'.format(self.domuuid), 'o')
self.dom = None
self.instop = False
@ -173,7 +175,9 @@ class VMInstance:
except ValueError:
pass
if self.inrestart == False:
self.zk.set('/domains/{}/state'.format(self.domuuid), 'stop'.encode('ascii'))
ansiiprint.echo('Successfully shutdown VM', '{}:'.format(self.domuuid), 'o')
self.dom = None
self.inshutdown = False