Skip collections during discovery, don't abort

This commit is contained in:
Markus Unterwaditzer 2015-02-22 14:42:58 +01:00
parent dec08780f3
commit e35479b080

View file

@ -201,10 +201,10 @@ def _handle_collection_not_found(config, collection, e=None):
except NotImplementedError as e: except NotImplementedError as e:
cli_logger.error(e) cli_logger.error(e)
raise CliError('Unable to find or create collection "{collection}" for ' raise exceptions.CollectionNotFound(
'storage "{storage}". Please create the collection ' 'Unable to find or create collection "{collection}" for storage '
'yourself.'.format(collection=collection, '"{storage}". Please create the collection yourself.'
storage=storage_name)) .format(collection=collection, storage=storage_name))
def _collections_for_pair_impl(status_path, name_a, name_b, pair_name, def _collections_for_pair_impl(status_path, name_a, name_b, pair_name,
@ -227,16 +227,20 @@ def _collections_for_pair_impl(status_path, name_a, name_b, pair_name,
for collection in collections: for collection in collections:
try: try:
a_args = a_discovered[collection] try:
except KeyError: a_args = a_discovered[collection]
a_args = _handle_collection_not_found(config_a, collection) except KeyError:
a_args = _handle_collection_not_found(config_a, collection)
try: try:
b_args = b_discovered[collection] b_args = b_discovered[collection]
except KeyError: except KeyError:
b_args = _handle_collection_not_found(config_b, collection) b_args = _handle_collection_not_found(config_b, collection)
except exceptions.CollectionNotFound as e:
yield collection, (a_args, b_args) cli_logger.warning('Skipping collection {}: {}'
.format(collection, str(e)))
else:
yield collection, (a_args, b_args)
def _validate_general_section(general_config): def _validate_general_section(general_config):