[ARVADOS] updated: f2170ad3c6c0f390d427c6b885527b1d1b09ffa3

git at public.curoverse.com git at public.curoverse.com
Mon Sep 15 14:20:18 EDT 2014


Summary of changes:
 sdk/python/arvados/commands/copy.py | 21 +++++++++++++++------
 1 file changed, 15 insertions(+), 6 deletions(-)

       via  f2170ad3c6c0f390d427c6b885527b1d1b09ffa3 (commit)
      from  e09e57378e5f98235e472a35c18a3e3a2bac97fb (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.


commit f2170ad3c6c0f390d427c6b885527b1d1b09ffa3
Author: Tim Pierce <twp at curoverse.com>
Date:   Mon Sep 15 14:20:00 2014 -0400

    3699: report success/failure unambiguously

diff --git a/sdk/python/arvados/commands/copy.py b/sdk/python/arvados/commands/copy.py
index 3fd54a0..dfdcd6a 100755
--- a/sdk/python/arvados/commands/copy.py
+++ b/sdk/python/arvados/commands/copy.py
@@ -84,7 +84,14 @@ def main():
     else:
         abort("cannot copy object {} of type {}".format(args.object_uuid, t))
 
-    print result
+    # If no exception was thrown and the response does not have an
+    # error_token field, presume success
+    if 'error_token' in result or 'uuid' not in result:
+        logger.error("API server returned an error result: {}".format(result))
+        exit(1)
+
+    logger.info("")
+    logger.info("Success: created copy with uuid {}".format(result['uuid']))
     exit(0)
 
 # api_for_instance(instance_name)
@@ -151,20 +158,22 @@ def copy_pipeline_instance(pi_uuid, src, dst, dst_git_repo, dst_project=None, re
         # pipeline template.
         if pi.get('pipeline_template_uuid', None):
             pi['pipeline_template_uuid'] = pt['uuid']
-        if dst_project:
-            pi['owner_uuid'] = dst_project
-        else:
-            del pi['owner_uuid']
 
     else:
         # not recursive
         print >>sys.stderr, "Copying only pipeline instance {}.".format(pi_uuid)
         print >>sys.stderr, "You are responsible for making sure all pipeline dependencies have been updated."
 
-    # Create the new pipeline instance at the destination Arvados.
+    # Update the pipeline instance properties, and create the new
+    # instance at dst.
     pi['properties']['copied_from_pipeline_instance_uuid'] = pi_uuid
+    if dst_project:
+        pi['owner_uuid'] = dst_project
+    else:
+        del pi['owner_uuid']
     del pi['uuid']
     pi['ensure_unique_name'] = True
+
     new_pi = dst.pipeline_instances().create(body=pi).execute()
     return new_pi
 

-----------------------------------------------------------------------


hooks/post-receive
-- 




More information about the arvados-commits mailing list