[ARVADOS] created: a6afada6f023621d2725fccf31a214a6d9e0a3e3
Git user
git at public.curoverse.com
Wed Jan 11 16:35:52 EST 2017
at a6afada6f023621d2725fccf31a214a6d9e0a3e3 (commit)
commit a6afada6f023621d2725fccf31a214a6d9e0a3e3
Author: Peter Amstutz <peter.amstutz at curoverse.com>
Date: Wed Jan 11 16:35:40 2017 -0500
10812: Fix check for collection reuse, same PDH and similar name.
diff --git a/sdk/python/arvados/commands/run.py b/sdk/python/arvados/commands/run.py
index 8403327..860fc8f 100644
--- a/sdk/python/arvados/commands/run.py
+++ b/sdk/python/arvados/commands/run.py
@@ -171,9 +171,13 @@ def uploadfiles(files, api, dry_run=False, num_retries=0, project=None, fnPatter
collection.start_new_stream(stream)
collection.write_file(f.fn, sp[1])
- exists = api.collections().list(filters=[["owner_uuid", "=", project],
- ["portable_data_hash", "=", collection.portable_data_hash()],
- ["name", "=", name]]).execute(num_retries=num_retries)
+ filters=[["portable_data_hash", "=", collection.portable_data_hash()],
+ ["name", "like", name+"%"]]
+ if project:
+ filters.append(["owner_uuid", "=", project])
+
+ exists = api.collections().list(filters=filters).execute(num_retries=num_retries)
+
if exists["items"]:
item = exists["items"][0]
logger.info("Using collection %s", item["uuid"])
-----------------------------------------------------------------------
hooks/post-receive
--
More information about the arvados-commits
mailing list