Fix shutdown abort during restart

Restart state, being different from shutdown, would trigger an abort of
the shutdown. Fix this by including restart in the valid states to
continue.
This commit is contained in:
Joshua Boniface 2019-09-07 12:08:31 -04:00
parent ed43c70f61
commit 983daceaed
1 changed files with 1 additions and 1 deletions

View File

@ -296,7 +296,7 @@ class VMInstance(object):
# Abort shutdown if the state changes to start # Abort shutdown if the state changes to start
current_state = zkhandler.readdata(self.zk_conn, '/domains/{}/state'.format(self.domuuid)) current_state = zkhandler.readdata(self.zk_conn, '/domains/{}/state'.format(self.domuuid))
if current_state != 'shutdown': if current_state not in ['shutdown', 'restart']:
self.logger.out('Aborting VM shutdown due to state change', state='i', prefix='Domain {}:'.format(self.domuuid)) self.logger.out('Aborting VM shutdown due to state change', state='i', prefix='Domain {}:'.format(self.domuuid))
is_aborted = True is_aborted = True
break break