From 506618c44e5cdd04f1a021c87d10d58ccf322f70 Mon Sep 17 00:00:00 2001 From: FUJITA Tomonori Date: Mon, 6 Dec 2010 11:45:06 +0900 Subject: [PATCH 1/2] object replicator: fix replica deletion condition --- swift/obj/replicator.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/swift/obj/replicator.py b/swift/obj/replicator.py index 9b0294627e..7559cd0933 100644 --- a/swift/obj/replicator.py +++ b/swift/obj/replicator.py @@ -494,7 +494,8 @@ class ObjectReplicator(Daemon): self.object_ring.get_part_nodes(int(partition)) if node['id'] != local_dev['id']] jobs.append(dict(path=join(obj_path, partition), - nodes=nodes, delete=len(nodes) > 2, + nodes=nodes, + delete=len(nodes) > self.object_ring.replica_count - 1, partition=partition)) except ValueError: continue From 371c610712c50a51b3838c6a9a3aa7624b35db9b Mon Sep 17 00:00:00 2001 From: Greg Lange Date: Thu, 9 Dec 2010 17:10:37 +0000 Subject: [PATCH 2/2] in st, skips directory creation when streaming to standard out --- bin/st | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/bin/st b/bin/st index 6a8b02bb37..3bd8b4f5bf 100755 --- a/bin/st +++ b/bin/st @@ -1020,8 +1020,9 @@ def st_download(options, args, print_queue, error_queue): path = options.yes_all and join(container, obj) or obj if path[:1] in ('/', '\\'): path = path[1:] + make_dir = out_file != "-" if content_type.split(';', 1)[0] == 'text/directory': - if not isdir(path): + if make_dir and not isdir(path): mkdirs(path) read_length = 0 md5sum = md5() @@ -1030,7 +1031,7 @@ def st_download(options, args, print_queue, error_queue): md5sum.update(chunk) else: dirpath = dirname(path) - if dirpath and not isdir(dirpath): + if make_dir and dirpath and not isdir(dirpath): mkdirs(dirpath) if out_file == "-": fp = stdout