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:
@ -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
|
||||||
|
Reference in New Issue
Block a user