diff --git a/trollduction/helper_functions.py b/trollduction/helper_functions.py index 1bdf811..1efdeff 100644 --- a/trollduction/helper_functions.py +++ b/trollduction/helper_functions.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# Copyright (c) 2014, 2015 +# Copyright (c) 2014, 2015, 2017 # # Author(s): # @@ -454,14 +454,15 @@ def eval_default(expression, default_res=None): def get_uri_from_message(msg, area_def_names=None): """Get URI from posttroll message.""" + if msg.type == "file": uri = msg.data['uri'] elif msg.type == "dataset": uri = [mda['uri'] for mda in msg.data['dataset']] elif msg.type == 'collection': if not msg.data['collection_area_id'] in area_def_names: - LOGGER.info('Collection does not contain data for ' - 'current areas. Skipping.') + LOGGER.warning('Collection does not contain data for ' + 'current areas: %s', str(area_def_names)) return None if 'dataset' in msg.data['collection'][0]: uri = [] diff --git a/trollduction/producer.py b/trollduction/producer.py index 4babc5b..7472d42 100644 --- a/trollduction/producer.py +++ b/trollduction/producer.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# Copyright (c) 2014-2016 +# Copyright (c) 2014-2017 # # Author(s): # @@ -597,6 +597,9 @@ def run(self, product_config, msg): uri = helper_functions.get_uri_from_message(msg, self.get_area_def_names()) + if not uri: + LOGGER.info("Skipping...") + return LOGGER.info('New data available: %s', uri) t1a = time.time()