Allow empty storage policies to work

* If a storage policy is specified with no drives an empty ring will still be created
* Run a "write_ring" instead of a rebalance for empty rings.

Fixes #621
This commit is contained in:
Andy McCrae 2014-11-24 14:55:41 +00:00
parent 6074510e1a
commit 4779ccd02d

View File

@ -178,7 +178,10 @@ def build_ring(build_name, repl, min_part_hours, part_power, hosts, validate=Fal
# Rebalance ring
if not validate:
run_and_wait(rb_main, ["swift-ring-builder", build_file, "rebalance"])
if not hosts:
run_and_wait(rb_main, ["swift-ring-builder", build_file, "write_ring"])
else:
run_and_wait(rb_main, ["swift-ring-builder", build_file, "rebalance"])
def main(setup):
# load the json file