Only stop log parser if it's actually running

This commit is contained in:
Joshua Boniface 2019-05-11 12:08:23 -04:00
parent 3cf573baf6
commit 9e806d30f9
1 changed files with 5 additions and 4 deletions

View File

@ -73,10 +73,11 @@ class DomainConsoleWatcherInstance(object):
# Stop execution thread
def stop(self):
self.logger.out('Stopping VM log parser', state='i', prefix='Domain {}:'.format(self.domuuid))
self.thread_stopper.set()
# Do one final flush
self.update()
if self.thread and self.thread.isAlive():
self.logger.out('Stopping VM log parser', state='i', prefix='Domain {}:'.format(self.domuuid))
self.thread_stopper.set()
# Do one final flush
self.update()
# Main entrypoint
def run(self):