[ARVADOS] updated: 41d21af33ca5e074f48467e9b500c53992e9866e

git at public.curoverse.com git at public.curoverse.com
Fri May 30 09:08:05 EDT 2014


Summary of changes:
 sdk/python/arvados/commands/put.py | 2 +-
 sdk/python/tests/test_arv-put.py   | 6 ++++++
 2 files changed, 7 insertions(+), 1 deletion(-)

       via  41d21af33ca5e074f48467e9b500c53992e9866e (commit)
      from  5e1c8439078e25d42e9c339694d0ce8581944870 (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 41d21af33ca5e074f48467e9b500c53992e9866e
Author: Brett Smith <brett at curoverse.com>
Date:   Fri May 30 09:08:50 2014 -0400

    2752: Avoid ResumeCache name collisions from concatenating paths.

diff --git a/sdk/python/arvados/commands/put.py b/sdk/python/arvados/commands/put.py
index 3229125..12f464e 100644
--- a/sdk/python/arvados/commands/put.py
+++ b/sdk/python/arvados/commands/put.py
@@ -172,7 +172,7 @@ class ResumeCache(object):
         md5 = hashlib.md5()
         md5.update(arvados.config.get('ARVADOS_API_HOST', '!nohost'))
         realpaths = sorted(os.path.realpath(path) for path in args.paths)
-        md5.update(''.join(realpaths))
+        md5.update('\0'.join(realpaths))
         if any(os.path.isdir(path) for path in realpaths):
             md5.update(str(max(args.max_manifest_depth, -1)))
         elif args.filename:
diff --git a/sdk/python/tests/test_arv-put.py b/sdk/python/tests/test_arv-put.py
index 41fb330..b19e1c5 100644
--- a/sdk/python/tests/test_arv-put.py
+++ b/sdk/python/tests/test_arv-put.py
@@ -65,6 +65,12 @@ class ArvadosPutResumeCacheTest(ArvadosBaseTestCase):
             self.cache_path_from_arglist(['-', '--filename', 'stdin']),
             self.cache_path_from_arglist(['--filename', 'stdin', '-']))
 
+    def test_cache_names_differ_for_similar_paths(self):
+        # This test needs names at / that don't exist on the real filesystem.
+        self.assertNotEqual(
+            self.cache_path_from_arglist(['/_arvputtest1', '/_arvputtest2']),
+            self.cache_path_from_arglist(['/_arvputtest1/_arvputtest2']))
+
     def test_cache_names_ignore_irrelevant_arguments(self):
         # Workaround: parse_arguments bails on --filename with a directory.
         path1 = self.cache_path_from_arglist(['/tmp'])

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


hooks/post-receive
-- 




More information about the arvados-commits mailing list