From ade4bcf9588c6789de53d13d1bc4d8a7d886f5db Mon Sep 17 00:00:00 2001 From: Martin Konecny Date: Mon, 10 Sep 2012 17:36:55 -0400 Subject: [PATCH 1/5] CC-4389: Convert all PHP errors to throw exceptions instead -fixed --- airtime_mvc/public/index.php | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/airtime_mvc/public/index.php b/airtime_mvc/public/index.php index 78f94c489..6335eb22a 100644 --- a/airtime_mvc/public/index.php +++ b/airtime_mvc/public/index.php @@ -1,8 +1,12 @@ Date: Mon, 10 Sep 2012 17:39:43 -0400 Subject: [PATCH 2/5] MM2: Normalize directory paths received from airtime once and for all. --- python_apps/media-monitor2/media/monitor/airtime.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/python_apps/media-monitor2/media/monitor/airtime.py b/python_apps/media-monitor2/media/monitor/airtime.py index bb8f1dd9d..a295686b1 100644 --- a/python_apps/media-monitor2/media/monitor/airtime.py +++ b/python_apps/media-monitor2/media/monitor/airtime.py @@ -54,6 +54,7 @@ class AirtimeNotifier(Loggable): message.ack() self.logger.info("Received md from RabbitMQ: %s" % str(body)) m = json.loads(message.body) + if 'directory' in m: m['directory'] = normpath(m['directory']) self.handler.message(m) class AirtimeMessageReceiver(Loggable): @@ -119,6 +120,7 @@ class AirtimeMessageReceiver(Loggable): % md_path, e) def new_watch(self, msg): + msg['directory'] = normpath(msg['directory']) self.logger.info("Creating watch for directory: '%s'" % msg['directory']) if not os.path.exists(msg['directory']): From 0dab4fa231582ae0fa6252394ea658582176129f Mon Sep 17 00:00:00 2001 From: Rudi Grinberg Date: Mon, 10 Sep 2012 17:40:03 -0400 Subject: [PATCH 3/5] cc-4388: Fixed. --- python_apps/media-monitor2/media/monitor/pure.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python_apps/media-monitor2/media/monitor/pure.py b/python_apps/media-monitor2/media/monitor/pure.py index d60373d26..480778ebc 100644 --- a/python_apps/media-monitor2/media/monitor/pure.py +++ b/python_apps/media-monitor2/media/monitor/pure.py @@ -296,7 +296,7 @@ def organized_path(old_path, root_path, orig_md): filepath = None ext = extension(old_path) def default_f(dictionary, key): - if key in dictionary: return len(dictionary[key]) == 0 + if key in dictionary: return len(str(dictionary[key])) == 0 else: return True # We set some metadata elements to a default "unknown" value because we use # these fields to create a path hence they cannot be empty Here "normal" From 160b28af5ddfa3b547ef67f26e50a818214c37fd Mon Sep 17 00:00:00 2001 From: Rudi Grinberg Date: Mon, 10 Sep 2012 17:42:59 -0400 Subject: [PATCH 4/5] Added flag for two different list_all_db_files requests. --- python_apps/api_clients/api_client.py | 1 + 1 file changed, 1 insertion(+) diff --git a/python_apps/api_clients/api_client.py b/python_apps/api_clients/api_client.py index d2fbf23be..130724f66 100644 --- a/python_apps/api_clients/api_client.py +++ b/python_apps/api_clients/api_client.py @@ -477,6 +477,7 @@ class AirtimeApiClient(): def list_all_db_files(self, dir_id, all_files=True): logger = self.logger try: + all_files = u"1" if all_files else u"0" url = self.construct_url("list_all_db_files") url = url.replace("%%dir_id%%", dir_id) url = url.replace("%%all%%", all_files) From 8bbc0bff941d76d475e60aeddac9f62aef7fb744 Mon Sep 17 00:00:00 2001 From: Martin Konecny Date: Mon, 10 Sep 2012 17:43:29 -0400 Subject: [PATCH 5/5] CC-4389: Convert all PHP errors to throw exceptions instead -echo to stdout as well --- airtime_mvc/public/index.php | 1 + 1 file changed, 1 insertion(+) diff --git a/airtime_mvc/public/index.php b/airtime_mvc/public/index.php index 6335eb22a..46b97adfc 100644 --- a/airtime_mvc/public/index.php +++ b/airtime_mvc/public/index.php @@ -57,6 +57,7 @@ try { $application->bootstrap()->run(); } } catch (Exception $e) { + echo $e->getMessage(); Logging::info($e->getMessage()); }