From 2e5b1d9ca8778e7a38aca10a193c629a62ea82ef Mon Sep 17 00:00:00 2001 From: Martin Konecny Date: Tue, 10 Jul 2012 10:48:44 -0400 Subject: [PATCH] CC-4092: Not checking for return type "None" on some function calls in media-monitor -fixed --- .../airtimefilemonitor/airtimemediamonitorbootstrap.py | 7 +++---- .../media-monitor/airtimefilemonitor/mediamonitorcommon.py | 5 ++++- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/python_apps/media-monitor/airtimefilemonitor/airtimemediamonitorbootstrap.py b/python_apps/media-monitor/airtimefilemonitor/airtimemediamonitorbootstrap.py index 54c0a6170..67574df63 100644 --- a/python_apps/media-monitor/airtimefilemonitor/airtimemediamonitorbootstrap.py +++ b/python_apps/media-monitor/airtimefilemonitor/airtimemediamonitorbootstrap.py @@ -117,10 +117,9 @@ class AirtimeMediaMonitorBootstrap(): stdout = self.mmc.exec_command(command) if stdout is None: - self.logger.error("Unrecoverable error when syncing db to filesystem.") - return - - new_files = stdout.splitlines() + new_files = [] + else: + new_files = stdout.splitlines() new_and_modified_files = set() for file_path in new_files: diff --git a/python_apps/media-monitor/airtimefilemonitor/mediamonitorcommon.py b/python_apps/media-monitor/airtimefilemonitor/mediamonitorcommon.py index 92d0d4ceb..2351c4b25 100644 --- a/python_apps/media-monitor/airtimefilemonitor/mediamonitorcommon.py +++ b/python_apps/media-monitor/airtimefilemonitor/mediamonitorcommon.py @@ -291,7 +291,10 @@ class MediaMonitorCommon: self.logger.debug(command) stdout = self.exec_command(command) - return stdout.splitlines() + if stdout is None: + return [] + else: + return stdout.splitlines() def touch_index_file(self): dirname = os.path.dirname(self.timestamp_file)