From 9e806d30f95029c2e8e4c2581048851d46ea708c Mon Sep 17 00:00:00 2001 From: Joshua Boniface Date: Sat, 11 May 2019 12:08:23 -0400 Subject: [PATCH] Only stop log parser if it's actually running --- node-daemon/pvcd/DomainConsoleWatcherInstance.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/node-daemon/pvcd/DomainConsoleWatcherInstance.py b/node-daemon/pvcd/DomainConsoleWatcherInstance.py index 36376f1a..8d8aa9de 100644 --- a/node-daemon/pvcd/DomainConsoleWatcherInstance.py +++ b/node-daemon/pvcd/DomainConsoleWatcherInstance.py @@ -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):