[ARVADOS] updated: 05dccfde466ca973b32e29983628a3d0f4df2607
git at public.curoverse.com
git at public.curoverse.com
Fri Jun 27 11:13:55 EDT 2014
Summary of changes:
sdk/python/arvados/collection.py | 17 ++++++++++++-----
1 file changed, 12 insertions(+), 5 deletions(-)
via 05dccfde466ca973b32e29983628a3d0f4df2607 (commit)
via 498c9aa9f1f944e885a3a26c83746e2e41326ca8 (commit)
from 6189e6d37b6f05bee599fb54cfb9e29f81665d75 (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 05dccfde466ca973b32e29983628a3d0f4df2607
Author: Peter Amstutz <peter.amstutz at curoverse.com>
Date: Fri Jun 27 11:11:50 2014 -0400
Handle empty directories in arv-put. refs #3087
diff --git a/sdk/python/arvados/collection.py b/sdk/python/arvados/collection.py
index a1195bf..e420a67 100644
--- a/sdk/python/arvados/collection.py
+++ b/sdk/python/arvados/collection.py
@@ -235,7 +235,11 @@ class CollectionWriter(object):
path, stream_name, max_manifest_depth = self._queued_trees[0]
make_dirents = (util.listdir_recursive if (max_manifest_depth == 0)
else os.listdir)
- self._queue_dirents(stream_name, make_dirents(path))
+ d = make_dirents(path)
+ if len(d) > 0:
+ self._queue_dirents(stream_name, d)
+ else:
+ self._queued_trees.popleft()
def _queue_file(self, source, filename=None):
assert (self._queued_file is None), "tried to queue more than one file"
@@ -379,10 +383,10 @@ class CollectionWriter(object):
manifest += ' ' + ' '.join("%d:%d:%s" % (sfile[0], sfile[1], sfile[2].replace(' ', '\\040')) for sfile in stream[2])
manifest += "\n"
- #print 'writer',manifest
- #print 'after reader',CollectionReader(manifest).manifest_text()
-
- return CollectionReader(manifest).manifest_text()
+ if len(manifest) > 0:
+ return CollectionReader(manifest).manifest_text()
+ else:
+ return ""
def data_locators(self):
ret = []
commit 498c9aa9f1f944e885a3a26c83746e2e41326ca8
Author: Peter Amstutz <peter.amstutz at curoverse.com>
Date: Fri Jun 27 10:57:24 2014 -0400
Handle zero-length streams that contain zero-length files. refs #3084
diff --git a/sdk/python/arvados/collection.py b/sdk/python/arvados/collection.py
index 8792348..a1195bf 100644
--- a/sdk/python/arvados/collection.py
+++ b/sdk/python/arvados/collection.py
@@ -41,6 +41,9 @@ def normalize_stream(s, stream):
blocks[b[arvados.LOCATOR]] = streamoffset
streamoffset += b[arvados.BLOCKSIZE]
+ if len(stream_tokens) == 1:
+ stream_tokens.append(config.EMPTY_BLOCK_LOCATOR)
+
for f in sortedfiles:
current_span = None
fout = f.replace(' ', '\\040')
-----------------------------------------------------------------------
hooks/post-receive
--
More information about the arvados-commits
mailing list