6844: Return valid locator (hash+size) if 0 copies requested.
authorTom Clegg <tom@clinicalfuture.com>
Fri, 7 Aug 2015 03:22:55 +0000 (03:22 +0000)
committerTom Clegg <tom@curoverse.com>
Fri, 7 Aug 2015 05:40:49 +0000 (01:40 -0400)
sdk/python/arvados/keep.py

index b2700ae5ba71dc9023ce8eb4f843a0d301b729b6..63b99daedd3d3931ac3822da62bff1d556d0806e 100644 (file)
@@ -932,9 +932,10 @@ class KeepClient(object):
             raise arvados.errors.ArgumentError("Argument 'data' to KeepClient.put is not type 'str'")
 
         data_hash = hashlib.md5(data).hexdigest()
+        loc_s = data_hash + '+' + str(len(data))
         if copies < 1:
-            return data_hash
-        locator = KeepLocator(data_hash + '+' + str(len(data)))
+            return loc_s
+        locator = KeepLocator(loc_s)
 
         headers = {}
         if self.using_proxy: