From e624d0345249145df510a5cbf68f94dbccf664e0 Mon Sep 17 00:00:00 2001 From: dixiaoli Date: Mon, 29 Feb 2016 11:01:17 +0800 Subject: [PATCH] Update OSC metavars OpenstackClient has a consistent pattern for the metavars on their arguments. Senlinclient's plugin should follow that pattern. Change-Id: I5e124a59ce17b26f1a7a3176dff7c4416f1f3e71 Blueprint: senlin-support-python-openstackclient --- senlinclient/osc/v1/action.py | 2 +- senlinclient/osc/v1/cluster.py | 8 ++++---- senlinclient/osc/v1/cluster_policy.py | 2 +- senlinclient/osc/v1/event.py | 2 +- senlinclient/osc/v1/node.py | 6 +++--- senlinclient/osc/v1/policy.py | 4 ++-- senlinclient/osc/v1/policy_type.py | 2 +- senlinclient/osc/v1/profile.py | 4 ++-- senlinclient/osc/v1/profile_type.py | 2 +- senlinclient/osc/v1/receiver.py | 2 +- 10 files changed, 17 insertions(+), 17 deletions(-) diff --git a/senlinclient/osc/v1/action.py b/senlinclient/osc/v1/action.py index c064dac2..4c2dc59e 100644 --- a/senlinclient/osc/v1/action.py +++ b/senlinclient/osc/v1/action.py @@ -43,7 +43,7 @@ class ListAction(lister.Lister): ) parser.add_argument( '--sort', - metavar='', + metavar='[:]', help=_("Sorting option which is a string containing a list of " "keys separated by commas. Each key can be optionally " "appended by a sort direction (:asc or :desc). The valid " diff --git a/senlinclient/osc/v1/cluster.py b/senlinclient/osc/v1/cluster.py index a41eaec8..223720eb 100644 --- a/senlinclient/osc/v1/cluster.py +++ b/senlinclient/osc/v1/cluster.py @@ -46,7 +46,7 @@ class ListCluster(lister.Lister): ) parser.add_argument( '--sort', - metavar='', + metavar='[:]', help=_("Sorting option which is a string containing a list of " "keys separated by commas. Each key can be optionally " "appended by a sort direction (:asc or :desc). The valid " @@ -190,7 +190,7 @@ class CreateCluster(show.ShowOne): ) parser.add_argument( 'name', - metavar='', + metavar='', help=_('Name of the cluster to create') ) return parser @@ -352,7 +352,7 @@ class ResizeCluster(command.Command): ) parser.add_argument( '--min-step', - metavar='', + metavar='', type=int, help=_('An integer specifying the number of nodes for adjustment ' 'when is specified') @@ -603,7 +603,7 @@ class ClusterNodeList(lister.Lister): ) parser.add_argument( '--sort', - metavar='', + metavar='[:]', help=_('Sorting option which is a string containing a list of ' 'keys separated by commas. Each key can be optionally ' 'appended by a sort direction (:asc or :desc)') diff --git a/senlinclient/osc/v1/cluster_policy.py b/senlinclient/osc/v1/cluster_policy.py index 5455948f..129529cd 100644 --- a/senlinclient/osc/v1/cluster_policy.py +++ b/senlinclient/osc/v1/cluster_policy.py @@ -42,7 +42,7 @@ class ClusterPolicyList(lister.Lister): ) parser.add_argument( '--sort', - metavar='', + metavar='[:]', help=_("Sorting option which is a string containing a list of " "keys separated by commas. Each key can be optionally " "appended by a sort direction (:asc or :desc). The valid " diff --git a/senlinclient/osc/v1/event.py b/senlinclient/osc/v1/event.py index 66495bdc..0bd43727 100644 --- a/senlinclient/osc/v1/event.py +++ b/senlinclient/osc/v1/event.py @@ -54,7 +54,7 @@ class ListEvent(lister.Lister): ) parser.add_argument( '--sort', - metavar='', + metavar='[:]', help=_("Sorting option which is a string containing a list of " "keys separated by commas. Each key can be optionally " "appended by a sort direction (:asc or :desc). The valid " diff --git a/senlinclient/osc/v1/node.py b/senlinclient/osc/v1/node.py index 7cbe732d..d917586f 100644 --- a/senlinclient/osc/v1/node.py +++ b/senlinclient/osc/v1/node.py @@ -51,7 +51,7 @@ class ListNode(lister.Lister): ) parser.add_argument( '--sort', - metavar='', + metavar='[:]', help=_("Sorting option which is a string containing a list of " "keys separated by commas. Each key can be optionally " "appended by a sort direction (:asc or :desc). The valid " @@ -200,7 +200,7 @@ class CreateNode(show.ShowOne): ) parser.add_argument( 'name', - metavar='', + metavar='', help=_('Name of the node to create') ) return parser @@ -235,7 +235,7 @@ class UpdateNode(show.ShowOne): ) parser.add_argument( '--profile', - metavar='', + metavar='', help=_('ID of new profile to use') ) parser.add_argument( diff --git a/senlinclient/osc/v1/policy.py b/senlinclient/osc/v1/policy.py index 070fb562..6c5d3a48 100644 --- a/senlinclient/osc/v1/policy.py +++ b/senlinclient/osc/v1/policy.py @@ -46,7 +46,7 @@ class ListPolicy(lister.Lister): ) parser.add_argument( '--sort', - metavar='', + metavar='[:]', help=_("Sorting option which is a string containing a list of " "keys separated by commas. Each key can be optionally " "appended by a sort direction (:asc or :desc). The valid " @@ -160,7 +160,7 @@ class CreatePolicy(show.ShowOne): parser = super(CreatePolicy, self).get_parser(prog_name) parser.add_argument( '--spec-file', - metavar='', + metavar='', required=True, help=_('The spec file used to create the policy') ) diff --git a/senlinclient/osc/v1/policy_type.py b/senlinclient/osc/v1/policy_type.py index 61350d2b..5df67d40 100644 --- a/senlinclient/osc/v1/policy_type.py +++ b/senlinclient/osc/v1/policy_type.py @@ -49,7 +49,7 @@ class PolicyTypeShow(format_utils.YamlFormat): parser = super(PolicyTypeShow, self).get_parser(prog_name) parser.add_argument( 'type_name', - metavar='', + metavar='', help=_('Policy type to retrieve') ) return parser diff --git a/senlinclient/osc/v1/profile.py b/senlinclient/osc/v1/profile.py index 7eb4cc37..5e9376ed 100644 --- a/senlinclient/osc/v1/profile.py +++ b/senlinclient/osc/v1/profile.py @@ -95,7 +95,7 @@ class ListProfile(lister.Lister): ) parser.add_argument( '--sort', - metavar='', + metavar='[:]', help=_("Sorting option which is a string containing a list of keys" " separated by commas. Each key can be optionally appended " "by a sort direction (:asc or :desc). The valid sort_keys " @@ -230,7 +230,7 @@ class CreateProfile(show.ShowOne): ) parser.add_argument( 'name', - metavar='', + metavar='', help=_('Name of the profile to create') ) return parser diff --git a/senlinclient/osc/v1/profile_type.py b/senlinclient/osc/v1/profile_type.py index 993edd0e..563dbd81 100644 --- a/senlinclient/osc/v1/profile_type.py +++ b/senlinclient/osc/v1/profile_type.py @@ -49,7 +49,7 @@ class ProfileTypeShow(format_utils.YamlFormat): parser = super(ProfileTypeShow, self).get_parser(prog_name) parser.add_argument( 'type_name', - metavar='', + metavar='', help=_('Profile type to retrieve') ) return parser diff --git a/senlinclient/osc/v1/receiver.py b/senlinclient/osc/v1/receiver.py index 10504582..13363927 100644 --- a/senlinclient/osc/v1/receiver.py +++ b/senlinclient/osc/v1/receiver.py @@ -56,7 +56,7 @@ class ListReceiver(lister.Lister): ) parser.add_argument( '--sort', - metavar='', + metavar='[:]', help=_("Sorting option which is a string containing a list of " "keys separated by commas. Each key can be optionally " "appended by a sort direction (:asc or :desc). The valid "