#!/usr/bin/env python

import argparse

from mc_solr.solr import reload_all_solr_shards

if __name__ == "__main__":
    parser = argparse.ArgumentParser(description="Reload Solr shards with updated configuration on ZooKeeper.",
                                     epilog="This script does not update configuration on ZooKeeper itself! " +
                                            "Run 'update_zookeeper_config.py' before.",
                                     formatter_class=argparse.ArgumentDefaultsHelpFormatter)
    parser.add_argument("-c", "--shard_count", type=int, required=True, help="Number of shards to expect on each host.")
    parser.add_argument("-s", "--hosts", type=str, required=False, action="store", nargs="*", default=["localhost"],
                        help="Hosts running Solr to reload.")

    args = parser.parse_args()

    for host in args.hosts:
        reload_all_solr_shards(shard_count=args.shard_count, host=host)

@@ -672,17 +672,16 @@
  %22--host
-s
 %22, type=
@@ -785,17 +785,19 @@
 lp=%22Host
-s
+(s)
  running
@@ -873,17 +873,16 @@
 rgs.host
-s
 :%0A      

Rename "hosts" to "host"