X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/347d974ab2a8e7eecf1f3edc472e03223b0ad1bf..6386f2aca83b477210bda19a3284ea31463d2efc:/sdk/python/arvados/collection.py diff --git a/sdk/python/arvados/collection.py b/sdk/python/arvados/collection.py index 400a88c5f2..686d694bef 100644 --- a/sdk/python/arvados/collection.py +++ b/sdk/python/arvados/collection.py @@ -98,7 +98,10 @@ class CollectionReader(object): if re.match(r'[a-f0-9]{32}(\+\d+)?(\+\S+)*$', manifest_locator_or_text): self._manifest_locator = manifest_locator_or_text self._manifest_text = None - elif re.match(r'(\S+)( [a-f0-9]{32}(\+\d+)(\+\S+)*)+( \d+:\d+:\S+)+\n', manifest_locator_or_text): + elif re.match(r'[a-z0-9]{5}-[a-z0-9]{5}-[a-z0-9]{15}$', manifest_locator_or_text): + self._manifest_locator = manifest_locator_or_text + self._manifest_text = None + elif re.match(r'((\S+)( [a-f0-9]{32}(\+\d+)(\+\S+)*)+( \d+:\d+:\S+)+$)+', manifest_locator_or_text, re.MULTILINE): self._manifest_text = manifest_locator_or_text self._manifest_locator = None else: @@ -132,6 +135,9 @@ class CollectionReader(object): uuid=self._manifest_locator).execute() self._manifest_text = c['manifest_text'] except Exception as e: + if not util.portable_data_hash_pattern.match( + self._manifest_locator): + raise _logger.warning("API lookup failed for collection %s (%s: %s)", self._manifest_locator, type(e), str(e)) if self._keep_client is None: