From f3c410040fb8b7f8e3c63f5fa97719b9769b0877 Mon Sep 17 00:00:00 2001 From: tengqm Date: Sat, 7 Feb 2015 12:08:40 +0800 Subject: [PATCH] Make profile a required argument This is a bug found by tiantian. There are other cases in client that need to be checked. --- senlinclient/v1/shell.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/senlinclient/v1/shell.py b/senlinclient/v1/shell.py index dd793f99..0093a2f2 100644 --- a/senlinclient/v1/shell.py +++ b/senlinclient/v1/shell.py @@ -294,10 +294,8 @@ def _show_cluster(sc, cluster_id): utils.print_dict(cluster.to_dict(), formatters=formatters) -@utils.arg('-p', '--profile', metavar='', - help=_('Profile Id used for this cluster.')) -@utils.arg('-n', '--size', metavar='', - help=_('Initial size of the cluster.')) +@utils.arg('-n', '--size', metavar='', default=0, + help=_('Initial size of the cluster. Default to 0.')) @utils.arg('-o', '--parent', metavar='', help=_('ID of the parent cluster, if exists.')) @utils.arg('-t', '--timeout', metavar='', type=int, @@ -306,7 +304,9 @@ def _show_cluster(sc, cluster_id): help=_('Tag values to be attached to the cluster. ' 'This can be specified multiple times, or once with tags' 'separated by a semicolon.'), - action='append') + action='append') +@utils.arg('-p', '--profile', metavar='', required=True, + help=_('Profile Id used for this cluster.')) @utils.arg('name', metavar='', help=_('Name of the cluster to create.')) def do_cluster_create(sc, args): @@ -346,7 +346,7 @@ def do_cluster_delete(sc, args): @utils.arg('-p', '--profile', metavar='', help=_('ID of new profile to use.')) -@utils.arg('-n', '--size', metavar='', +@utils.arg('-n', '--size', metavar='', help=_('Initial size of the cluster.')) @utils.arg('-t', '--timeout', metavar='', type=int,