Make profile a required argument

This is a bug found by tiantian. There are other cases in client that
need to be checked.
This commit is contained in:
tengqm 2015-02-07 12:08:40 +08:00
parent 2217caed37
commit f3c410040f

View File

@ -294,10 +294,8 @@ def _show_cluster(sc, cluster_id):
utils.print_dict(cluster.to_dict(), formatters=formatters) utils.print_dict(cluster.to_dict(), formatters=formatters)
@utils.arg('-p', '--profile', metavar='<PROFILE ID>', @utils.arg('-n', '--size', metavar='<SIZE>', default=0,
help=_('Profile Id used for this cluster.')) help=_('Initial size of the cluster. Default to 0.'))
@utils.arg('-n', '--size', metavar='<NUMBER>',
help=_('Initial size of the cluster.'))
@utils.arg('-o', '--parent', metavar='<PARENT_ID>', @utils.arg('-o', '--parent', metavar='<PARENT_ID>',
help=_('ID of the parent cluster, if exists.')) help=_('ID of the parent cluster, if exists.'))
@utils.arg('-t', '--timeout', metavar='<TIMEOUT>', type=int, @utils.arg('-t', '--timeout', metavar='<TIMEOUT>', type=int,
@ -306,7 +304,9 @@ def _show_cluster(sc, cluster_id):
help=_('Tag values to be attached to the cluster. ' help=_('Tag values to be attached to the cluster. '
'This can be specified multiple times, or once with tags' 'This can be specified multiple times, or once with tags'
'separated by a semicolon.'), 'separated by a semicolon.'),
action='append') action='append')
@utils.arg('-p', '--profile', metavar='<PROFILE>', required=True,
help=_('Profile Id used for this cluster.'))
@utils.arg('name', metavar='<CLUSTER_NAME>', @utils.arg('name', metavar='<CLUSTER_NAME>',
help=_('Name of the cluster to create.')) help=_('Name of the cluster to create.'))
def do_cluster_create(sc, args): def do_cluster_create(sc, args):
@ -346,7 +346,7 @@ def do_cluster_delete(sc, args):
@utils.arg('-p', '--profile', metavar='<PROFILE ID>', @utils.arg('-p', '--profile', metavar='<PROFILE ID>',
help=_('ID of new profile to use.')) help=_('ID of new profile to use.'))
@utils.arg('-n', '--size', metavar='<NUMBER>', @utils.arg('-n', '--size', metavar='<SIZE>',
help=_('Initial size of the cluster.')) help=_('Initial size of the cluster.'))
@utils.arg('-t', '--timeout', metavar='<TIMEOUT>', @utils.arg('-t', '--timeout', metavar='<TIMEOUT>',
type=int, type=int,