Merge branch 'master' into 3036-collection-uuids
[arvados.git] / sdk / python / arvados / commands / put.py
index 8cf56b6a38ab864143ba2bac9927e5e22ea4129d..7b6b048b1d035adc7b3b3399fd77a2c81e3bed3b 100644 (file)
@@ -457,12 +457,16 @@ def main(arguments=None, stdout=sys.stdout, stderr=sys.stderr):
                 },
             ).execute()
 
-        output = collection['uuid']
+        if 'portable_data_hash' in collection and collection['portable_data_hash']:
+            output = collection['portable_data_hash']
+        else:
+            output = collection['uuid']
+
         if project_link is not None:
             # Update collection name
             try:
                 if 'name' in collection:
-                    arvados.api().collections().update(uuid=output,
+                    arvados.api().collections().update(uuid=collection['uuid'],
                                                        body={"name": project_link["name"]}).execute()
                 else:
                     create_project_link(output, project_link)