[ARVADOS] updated: c86fec0e51f30b2771c9ae95152f76b438db6542

Git user git at public.curoverse.com
Fri Dec 9 18:05:21 EST 2016


Summary of changes:
 sdk/python/arvados/commands/put.py | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

       via  c86fec0e51f30b2771c9ae95152f76b438db6542 (commit)
      from  2e104941dbf1e4bf92e0632cadeb946be0595d67 (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 c86fec0e51f30b2771c9ae95152f76b438db6542
Author: Lucas Di Pentima <lucas at curoverse.com>
Date:   Fri Dec 9 20:04:44 2016 -0300

    10383: Start cache file from scratch when using --no-resume

diff --git a/sdk/python/arvados/commands/put.py b/sdk/python/arvados/commands/put.py
index 88d5a79..2ebe759 100644
--- a/sdk/python/arvados/commands/put.py
+++ b/sdk/python/arvados/commands/put.py
@@ -422,7 +422,7 @@ class ArvPutUploadJob(object):
                 num_retries=self.num_retries)
 
     def destroy_cache(self):
-        if self.resume:
+        if self.use_cache:
             try:
                 os.unlink(self._cache_filename)
             except OSError as error:
@@ -590,9 +590,14 @@ class ArvPutUploadJob(object):
             if self.filename:
                 md5.update(self.filename)
             cache_filename = md5.hexdigest()
-            self._cache_file = open(os.path.join(
+            cache_filepath = os.path.join(
                 arv_cmd.make_home_conf_dir(self.CACHE_DIR, 0o700, 'raise'),
-                cache_filename), 'a+')
+                cache_filename)
+            if self.resume:
+                self._cache_file = open(cache_filepath, 'a+')
+            else:
+                # --no-resume means start with a empty cache file.
+                self._cache_file = open(cache_filepath, 'w+')
             self._cache_filename = self._cache_file.name
             self._lock_file(self._cache_file)
             self._cache_file.seek(0)

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


hooks/post-receive
-- 




More information about the arvados-commits mailing list