From a619b79c3b70714bfc5355c67859658a32e38f16 Mon Sep 17 00:00:00 2001 From: Ethan Lynn <xjunlin@cn.ibm.com> Date: Thu, 11 Aug 2016 22:13:40 +0800 Subject: [PATCH] Reorder required parameters This patch put required parameters to an visible position. Change-Id: Ib68ab28c8f616d912b81ee38ec6325e087f6c648 --- senlinclient/v1/cluster.py | 24 ++++++++++++------------ senlinclient/v1/node.py | 12 ++++++------ senlinclient/v1/profile.py | 12 ++++++------ senlinclient/v1/receiver.py | 14 +++++++------- 4 files changed, 31 insertions(+), 31 deletions(-) diff --git a/senlinclient/v1/cluster.py b/senlinclient/v1/cluster.py index 42ad22ba..d612f256 100644 --- a/senlinclient/v1/cluster.py +++ b/senlinclient/v1/cluster.py @@ -148,12 +148,6 @@ class CreateCluster(command.ShowOne): def get_parser(self, prog_name): parser = super(CreateCluster, self).get_parser(prog_name) - parser.add_argument( - '--profile', - metavar='<profile>', - required=True, - help=_('Profile Id used for this cluster') - ) parser.add_argument( '--min-size', metavar='<min-size>', @@ -187,6 +181,12 @@ class CreateCluster(command.ShowOne): 'key-value pairs separated by a semicolon.'), action='append' ) + parser.add_argument( + '--profile', + metavar='<profile>', + required=True, + help=_('Profile Id used for this cluster') + ) parser.add_argument( 'name', metavar='<cluster-name>', @@ -521,12 +521,6 @@ class ClusterPolicyAttach(command.Command): def get_parser(self, prog_name): parser = super(ClusterPolicyAttach, self).get_parser(prog_name) - parser.add_argument( - '--policy', - metavar='<policy>', - required=True, - help=_('ID or name of policy to be attached') - ) parser.add_argument( '--enabled', default=True, @@ -534,6 +528,12 @@ class ClusterPolicyAttach(command.Command): help=_('Whether the policy should be enabled once attached. ' 'Default to True') ) + parser.add_argument( + '--policy', + metavar='<policy>', + required=True, + help=_('ID or name of policy to be attached') + ) parser.add_argument( 'cluster', metavar='<cluster>', diff --git a/senlinclient/v1/node.py b/senlinclient/v1/node.py index 780bc6f0..6a5e158e 100644 --- a/senlinclient/v1/node.py +++ b/senlinclient/v1/node.py @@ -172,12 +172,6 @@ class CreateNode(command.ShowOne): def get_parser(self, prog_name): parser = super(CreateNode, self).get_parser(prog_name) - parser.add_argument( - '--profile', - metavar='<profile>', - required=True, - help=_('Profile Id or Name used for this node') - ) parser.add_argument( '--cluster', metavar='<cluster>', @@ -196,6 +190,12 @@ class CreateNode(command.ShowOne): 'key-value pairs separated by a semicolon'), action='append' ) + parser.add_argument( + '--profile', + metavar='<profile>', + required=True, + help=_('Profile Id or Name used for this node') + ) parser.add_argument( 'name', metavar='<node-name>', diff --git a/senlinclient/v1/profile.py b/senlinclient/v1/profile.py index 56b57d2e..db2500eb 100644 --- a/senlinclient/v1/profile.py +++ b/senlinclient/v1/profile.py @@ -212,12 +212,6 @@ class CreateProfile(command.ShowOne): def get_parser(self, prog_name): parser = super(CreateProfile, self).get_parser(prog_name) - parser.add_argument( - '--spec-file', - metavar='<spec-file>', - required=True, - help=_('The spec file used to create the profile') - ) parser.add_argument( '--metadata', metavar='<key1=value1;key2=value2...>', @@ -226,6 +220,12 @@ class CreateProfile(command.ShowOne): 'key-value pairs separated by a semicolon'), action='append' ) + parser.add_argument( + '--spec-file', + metavar='<spec-file>', + required=True, + help=_('The spec file used to create the profile') + ) parser.add_argument( 'name', metavar='<profile-name>', diff --git a/senlinclient/v1/receiver.py b/senlinclient/v1/receiver.py index c2ce9dd4..fda140be 100644 --- a/senlinclient/v1/receiver.py +++ b/senlinclient/v1/receiver.py @@ -159,6 +159,13 @@ class CreateReceiver(command.ShowOne): default='webhook', help=_('Type of the receiver to create') ) + parser.add_argument( + '--params', + metavar='<key1=value1;key2=value2...>', + help=_('A dictionary of parameters that will be passed to target ' + 'action when the receiver is triggered'), + action='append' + ) parser.add_argument( '--cluster', metavar='<cluster>', @@ -171,13 +178,6 @@ class CreateReceiver(command.ShowOne): required=True, help=_('Name or ID of the targeted action to be triggered') ) - parser.add_argument( - '--params', - metavar='<key1=value1;key2=value2...>', - help=_('A dictionary of parameters that will be passed to target ' - 'action when the receiver is triggered'), - action='append' - ) parser.add_argument( 'name', metavar='<name>',