From c9ff30dfdb5f520013692d2e3caddcd20428d8b9 Mon Sep 17 00:00:00 2001 From: Telles Nobrega Date: Mon, 29 Jun 2015 13:45:14 -0300 Subject: Allow multiple clusters creation This patch allows the user to use the client to create multiple clusters Change-Id: I3b48d6ede758e86e8cbc5bbccc069c4c24b53a44 Partially-implements: bp simultaneously-creating-multiple-clusters --- saharaclient/api/shell.py | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'saharaclient/api/shell.py') diff --git a/saharaclient/api/shell.py b/saharaclient/api/shell.py index 3b46057..5a3812c 100644 --- a/saharaclient/api/shell.py +++ b/saharaclient/api/shell.py @@ -317,6 +317,10 @@ def do_cluster_show(cs, args): default=sys.stdin, type=argparse.FileType('r'), help='JSON representation of cluster.') +@utils.arg('--count', + default=1, + type=int, + help='Number of clusters to be created.') def do_cluster_create(cs, args): """Create a cluster.""" # TODO(mattf): improve template validation, e.g. template w/o name key @@ -326,6 +330,7 @@ def do_cluster_create(cs, args): # create w/ **template. It may be desirable to simple change # clusters.create in the future. remap = {'neutron_management_network': 'net_id'} + template['count'] = args.count _filter_call_args(template, cs.clusters.create, remap) _show_cluster(cs.clusters.create(**template)) -- cgit v1.2.1