3149: Merge branch 'master' into 3149-server-side-search
[arvados.git] / sdk / python / bin / arv-get
index 7f02cf73df1e6ce242607d202d3c143d8a9c66b2..0d403d103668528ba780b6c084d6601b8b5928c3 100755 (executable)
@@ -126,6 +126,7 @@ if args.r and not get_prefix:
 
 todo = []
 todo_bytes = 0
+api_client = arvados.api('v1')
 if not get_prefix:
     try:
         if not args.n:
@@ -133,15 +134,15 @@ if not get_prefix:
                 abort('Local file %s already exists.' % (args.destination,))
             with open(args.destination, 'wb') as f:
                 try:
-                    c = arvados.api('v1').collections().get(
-                        uuid=collection).execute()
+                    c = api_client.collections().get(uuid=collection).execute()
                     manifest = c['manifest_text']
                 except Exception as e:
                     logger.warning(
                         "Collection %s not found. " +
                         "Trying to fetch directly from Keep (deprecated).",
                         collection)
-                    manifest = arvados.Keep.get(collection)
+                    manifest = arvados.KeepClient(
+                        api_client=api_client).get(collection)
                 f.write(manifest)
         sys.exit(0)
     except arvados.errors.NotFoundError as e: