diff --git a/python_apps/pypo/pypofetch.py b/python_apps/pypo/pypofetch.py index 535d0fa99..7c50b4e2d 100644 --- a/python_apps/pypo/pypofetch.py +++ b/python_apps/pypo/pypofetch.py @@ -9,6 +9,7 @@ import telnetlib import copy from threading import Thread import subprocess +import traceback from Queue import Empty @@ -119,7 +120,6 @@ class PypoFetch(Thread): self.listener_timeout = 0 self.logger.info("New timeout: %s" % self.listener_timeout) except Exception, e: - import traceback top = traceback.format_exc() self.logger.error('Exception: %s', e) self.logger.error("traceback: %s", top) @@ -536,8 +536,12 @@ class PypoFetch(Thread): #being incorrect!) if not self.is_file_opened(path): os.remove(path) + self.logger.info("File '%s' removed" % path) + else: + self.logger.info("File '%s' not removed. Still busy!" % path) except Exception, e: - self.logger.error(e) + self.logger.error("Problem removing file '%s'" % f) + self.logger.error(traceback.format_exc()) def manual_schedule_fetch(self): success, self.schedule_data = self.api_client.get_schedule() @@ -588,7 +592,6 @@ class PypoFetch(Thread): self.logger.info("Queue timeout. Fetching schedule manually") self.persistent_manual_schedule_fetch(max_attempts=5) except Exception, e: - import traceback top = traceback.format_exc() self.logger.error('Exception: %s', e) self.logger.error("traceback: %s", top)