Merge "Update OSC metavars"

This commit is contained in:
Jenkins 2016-02-28 22:31:00 +00:00 committed by Gerrit Code Review
commit 4e6e9f092f
7 changed files with 78 additions and 77 deletions

View File

@ -33,17 +33,17 @@ class ShowEvent(show.ShowOne):
parser = super(ShowEvent, self).get_parser(prog_name)
parser.add_argument(
'stack',
metavar='<NAME or ID>',
metavar='<stack>',
help=_('Name or ID of stack to show events for')
)
parser.add_argument(
'resource',
metavar='<RESOURCE>',
metavar='<resource>',
help=_('Name of the resource event belongs to')
)
parser.add_argument(
'event',
metavar='<EVENT>',
metavar='<event>',
help=_('ID of event to display details for')
)
@ -93,42 +93,42 @@ class ListEvent(lister.Lister):
parser = super(ListEvent, self).get_parser(prog_name)
parser.add_argument(
'stack',
metavar='<NAME or ID>',
metavar='<stack>',
help=_('Name or ID of stack to show events for')
)
parser.add_argument(
'--resource',
metavar='<RESOURCE>',
metavar='<resource>',
help=_('Name of resource to show events for. Note: this cannot '
'be specified with --nested-depth')
)
parser.add_argument(
'--filter',
metavar='<KEY=VALUE>',
metavar='<key=value>',
action='append',
help=_('Filter parameters to apply on returned events')
)
parser.add_argument(
'--limit',
metavar='<LIMIT>',
metavar='<limit>',
type=int,
help=_('Limit the number of events returned')
)
parser.add_argument(
'--marker',
metavar='<ID>',
metavar='<id>',
help=_('Only return events that appear after the given ID')
)
parser.add_argument(
'--nested-depth',
metavar='<DEPTH>',
metavar='<depth>',
type=int,
help=_('Depth of nested stacks from which to display events. '
'Note: this cannot be specified with --resource')
)
parser.add_argument(
'--sort',
metavar='<KEY>[:<DIRECTION>]',
metavar='<key>[:<direction>]',
action='append',
help=_('Sort output by selected keys and directions (asc or desc) '
'(default: asc). Specify multiple times to sort on '

View File

@ -93,7 +93,7 @@ class ResourceList(lister.Lister):
)
parser.add_argument(
'-n', '--nested-depth',
metavar='<DEPTH>',
metavar='<nested-depth>',
type=int,
help=_('Depth of nested stacks from which to display resources')
)
@ -152,12 +152,12 @@ class ResourceMetadata(format_utils.JsonFormat):
parser = super(ResourceMetadata, self).get_parser(prog_name)
parser.add_argument(
'stack',
metavar='<STACK>',
metavar='<stack>',
help=_('Stack to display (name or ID)'),
)
parser.add_argument(
'resource',
metavar='<RESOURCE>',
metavar='<resource>',
help=_('Name of the resource to show the metadata for'))
return parser
@ -193,22 +193,22 @@ class ResourceSignal(command.Command):
parser = super(ResourceSignal, self).get_parser(prog_name)
parser.add_argument(
'stack',
metavar='<STACK>',
metavar='<stack>',
help=_('Name or ID of stack the resource belongs to'),
)
parser.add_argument(
'resource',
metavar='<RESOURCE>',
metavar='<resource>',
help=_('Name of the resoure to signal'),
)
parser.add_argument(
'--data',
metavar='<DATA>',
metavar='<data>',
help=_('JSON Data to send to the signal handler')
)
parser.add_argument(
'--data-file',
metavar='<DATA_FILE>',
metavar='<data-file>',
help=_('File containing JSON data to send to the signal handler')
)
return parser

View File

@ -34,12 +34,12 @@ class ResourceTypeShow(format_utils.YamlFormat):
self).get_parser(prog_name)
parser.add_argument(
'resource_type',
metavar='<RESOURCE_TYPE>',
metavar='<resource-type>',
help=_('Resource type to show details for'),
)
parser.add_argument(
'--template-type',
metavar='<TEMPLATE_TYPE>',
metavar='<template-type>',
help=_('Optional template type to generate, hot or cfn')
)
return parser
@ -84,7 +84,7 @@ class ResourceTypeList(lister.Lister):
parser.add_argument(
'--filter',
dest='filter',
metavar='<KEY=VALUE>',
metavar='<key=value>',
help=_('Filter parameters to apply on returned resource types. '
'This can be specified multiple times. It can be any of '
'name, version or support_status'),

View File

@ -39,8 +39,8 @@ class DeleteConfig(command.Command):
def get_parser(self, prog_name):
parser = super(DeleteConfig, self).get_parser(prog_name)
parser.add_argument(
'id',
metavar='<ID>',
'config',
metavar='<config>',
nargs='+',
help=_('IDs of the software configs to delete')
)
@ -56,7 +56,7 @@ class DeleteConfig(command.Command):
def _delete_config(heat_client, args):
failure_count = 0
for config_id in args.id:
for config_id in args.config:
try:
heat_client.software_configs.delete(
config_id=config_id)
@ -70,7 +70,7 @@ def _delete_config(heat_client, args):
raise exc.CommandError(_('Unable to delete %(count)s of the '
'%(total)s software configs.') %
{'count': failure_count,
'total': len(args.id)})
'total': len(args.config)})
class ListConfig(lister.Lister):
@ -82,12 +82,12 @@ class ListConfig(lister.Lister):
parser = super(ListConfig, self).get_parser(prog_name)
parser.add_argument(
'--limit',
metavar='<LIMIT>',
metavar='<limit>',
help=_('Limit the number of configs returned')
)
parser.add_argument(
'--marker',
metavar='<ID>',
metavar='<id>',
help=_('Return configs that appear after the given config ID')
)
return parser
@ -119,23 +119,23 @@ class CreateConfig(format_utils.JsonFormat):
parser = super(CreateConfig, self).get_parser(prog_name)
parser.add_argument(
'name',
metavar='<CONFIG_NAME>',
metavar='<config-name>',
help=_('Name of the software config to create')
)
parser.add_argument(
'--config-file',
metavar='<FILE or URL>',
metavar='<config-file>',
help=_('Path to JSON/YAML containing map defining '
'<inputs>, <outputs>, and <options>')
)
parser.add_argument(
'--definition-file',
metavar='<FILE or URL>',
metavar='<destination-file>',
help=_('Path to software config script/data')
)
parser.add_argument(
'--group',
metavar='<GROUP_NAME>',
metavar='<group>',
default='Heat::Ungrouped',
help=_('Group name of tool expected by the software config')
)
@ -196,8 +196,8 @@ class ShowConfig(format_utils.YamlFormat):
def get_parser(self, prog_name):
parser = super(ShowConfig, self).get_parser(prog_name)
parser.add_argument(
'id',
metavar='<ID>',
'config',
metavar='<config>',
help=_('ID of the config')
)
parser.add_argument(
@ -211,7 +211,7 @@ class ShowConfig(format_utils.YamlFormat):
def take_action(self, parsed_args):
self.log.debug("take_action(%s)", parsed_args)
heat_client = self.app.client_manager.orchestration
return _show_config(heat_client, config_id=parsed_args.id,
return _show_config(heat_client, config_id=parsed_args.config,
config_only=parsed_args.config_only)

View File

@ -39,21 +39,21 @@ class CreateDeployment(format_utils.YamlFormat):
parser = super(CreateDeployment, self).get_parser(prog_name)
parser.add_argument(
'name',
metavar='<DEPLOYMENT_NAME>',
metavar='<deployment-name>',
help=_('Name of the derived config associated with this '
'deployment. This is used to apply a sort order to the '
'list of configurations currently deployed to the server.')
)
parser.add_argument(
'--input-value',
metavar='<KEY=VALUE>',
metavar='<key=value>',
action='append',
help=_('Input value to set on the deployment. This can be '
'specified multiple times.')
)
parser.add_argument(
'--action',
metavar='<ACTION>',
metavar='<action>',
default='UPDATE',
help=_('Name of an action for this deployment. This can be a '
'custom action, or one of CREATE, UPDATE, DELETE, SUSPEND, '
@ -61,18 +61,18 @@ class CreateDeployment(format_utils.YamlFormat):
)
parser.add_argument(
'--config',
metavar='<CONFIG>',
metavar='<config>',
help=_('ID of the configuration to deploy')
)
parser.add_argument(
'--server',
metavar='<SERVER>',
metavar='<server>',
required=True,
help=_('ID of the server being deployed to')
)
parser.add_argument(
'--signal-transport',
metavar='<TRANSPORT>',
metavar='<signal-transport>',
default='TEMP_URL_SIGNAL',
help=_('How the server should signal to heat with the deployment '
'output values. TEMP_URL_SIGNAL will create a Swift '
@ -84,13 +84,14 @@ class CreateDeployment(format_utils.YamlFormat):
)
parser.add_argument(
'--container',
metavar='<CONTAINER_NAME>',
metavar='<container>',
help=_('Optional name of container to store TEMP_URL_SIGNAL '
'objects in. If not specified a container will be created '
'with a name derived from the DEPLOY_NAME')
)
parser.add_argument(
'--timeout',
metavar='<timeout>',
type=int,
default=60,
help=_('Deployment timeout in minutes')
@ -190,7 +191,7 @@ class ListDeployment(lister.Lister):
parser = super(ListDeployment, self).get_parser(prog_name)
parser.add_argument(
'--server',
metavar='<SERVER>',
metavar='<server>',
help=_('ID of the server to fetch deployments for')
)
parser.add_argument(

View File

@ -57,25 +57,25 @@ class CreateStack(show.ShowOne):
parser = super(CreateStack, self).get_parser(prog_name)
parser.add_argument(
'-t', '--template',
metavar='<FILE or URL>',
metavar='<template>',
required=True,
help=_('Path to the template')
)
parser.add_argument(
'-e', '--environment',
metavar='<FILE or URL>',
metavar='<environment>',
action='append',
help=_('Path to the environment. Can be specified multiple times')
)
parser.add_argument(
'--timeout',
metavar='<TIMEOUT>',
metavar='<timeout>',
type=int,
help=_('Stack creating timeout in minutes')
)
parser.add_argument(
'--pre-create',
metavar='<RESOURCE>',
metavar='<resource>',
default=None,
action='append',
help=_('Name of a resource to set a pre-create hook to. Resources '
@ -92,14 +92,14 @@ class CreateStack(show.ShowOne):
)
parser.add_argument(
'--parameter',
metavar='<KEY=VALUE>',
metavar='<key=value>',
action='append',
help=_('Parameter values used to create the stack. This can be '
'specified multiple times')
)
parser.add_argument(
'--parameter-file',
metavar='<KEY=FILE>',
metavar='<key=file>',
action='append',
help=_('Parameter values from file used to create the stack. '
'This can be specified multiple times. Parameter values '
@ -112,7 +112,7 @@ class CreateStack(show.ShowOne):
)
parser.add_argument(
'--tags',
metavar='<TAG1,TAG2...>',
metavar='<tag1,tag2...>',
help=_('A list of tags to associate with the stack')
)
parser.add_argument(
@ -123,7 +123,7 @@ class CreateStack(show.ShowOne):
)
parser.add_argument(
'name',
metavar='<STACK_NAME>',
metavar='<stack-name>',
help=_('Name of the stack to create')
)
@ -207,16 +207,16 @@ class UpdateStack(show.ShowOne):
def get_parser(self, prog_name):
parser = super(UpdateStack, self).get_parser(prog_name)
parser.add_argument(
'-t', '--template', metavar='<FILE or URL>',
'-t', '--template', metavar='<template>',
help=_('Path to the template')
)
parser.add_argument(
'-e', '--environment', metavar='<FILE or URL>',
'-e', '--environment', metavar='<environment>',
action='append',
help=_('Path to the environment. Can be specified multiple times')
)
parser.add_argument(
'--pre-update', metavar='<RESOURCE>', action='append',
'--pre-update', metavar='<resource>', action='append',
help=_('Name of a resource to set a pre-update hook to. Resources '
'in nested stacks can be set using slash as a separator: '
'nested_stack/another/my_resource. You can use wildcards '
@ -225,11 +225,11 @@ class UpdateStack(show.ShowOne):
'multiple times')
)
parser.add_argument(
'--timeout', metavar='<TIMEOUT>', type=int,
'--timeout', metavar='<timeout>', type=int,
help=_('Stack update timeout in minutes')
)
parser.add_argument(
'--rollback', metavar='<VALUE>',
'--rollback', metavar='<value>',
help=_('Set rollback on update failure. '
'Value "enabled" sets rollback to enabled. '
'Value "disabled" sets rollback to disabled. '
@ -242,13 +242,13 @@ class UpdateStack(show.ShowOne):
'would be changed')
)
parser.add_argument(
'--parameter', metavar='<KEY=VALUE>',
'--parameter', metavar='<key=value>',
help=_('Parameter values used to create the stack. '
'This can be specified multiple times'),
action='append'
)
parser.add_argument(
'--parameter-file', metavar='<KEY=FILE>',
'--parameter-file', metavar='<key=file>',
help=_('Parameter values from file used to create the stack. '
'This can be specified multiple times. Parameter value '
'would be the content of the file'),
@ -266,7 +266,7 @@ class UpdateStack(show.ShowOne):
'arg': '--parameter', 'env_arg': '--environment'}
)
parser.add_argument(
'--clear-parameter', metavar='<PARAMETER>',
'--clear-parameter', metavar='<parameter>',
help=_('Remove the parameters from the set of parameters of '
'current stack for the %(cmd)s. The default value in the '
'template will be used. This can be specified multiple '
@ -274,11 +274,11 @@ class UpdateStack(show.ShowOne):
action='append'
)
parser.add_argument(
'stack', metavar='<STACK>',
'stack', metavar='<stack>',
help=_('Name or ID of stack to update')
)
parser.add_argument(
'--tags', metavar='<TAG1,TAG2>',
'--tags', metavar='<tag1,tag2...>',
help=_('An updated list of tags to associate with the stack')
)
parser.add_argument(
@ -463,37 +463,37 @@ class ListStack(lister.Lister):
parser.add_argument(
'--property',
dest='properties',
metavar='<KEY=VALUE>',
metavar='<key=value>',
help=_('Filter properties to apply on returned stacks (repeat to '
'filter on multiple properties)'),
action=parseractions.KeyValueAction
)
parser.add_argument(
'--tags',
metavar='<TAG1,TAG2...>',
metavar='<tag1,tag2...>',
help=_('List of tags to filter by. Can be combined with '
'--tag-mode to specify how to filter tags')
)
parser.add_argument(
'--tag-mode',
metavar='<MODE>',
metavar='<mode>',
help=_('Method of filtering tags. Must be one of "any", "not", '
'or "not-any". If not specified, multiple tags will be '
'combined with the boolean AND expression')
)
parser.add_argument(
'--limit',
metavar='<LIMIT>',
metavar='<limit>',
help=_('The number of stacks returned')
)
parser.add_argument(
'--marker',
metavar='<ID>',
metavar='<id>',
help=_('Only return stacks that appear after the given ID')
)
parser.add_argument(
'--sort',
metavar='<KEY>[:<DIRECTION>]',
metavar='<key>[:<direction>]',
help=_('Sort output by selected keys and directions (asc or desc) '
'(default: asc). Specify multiple times to sort on '
'multiple properties')
@ -666,24 +666,24 @@ class AdoptStack(show.ShowOne):
parser = super(AdoptStack, self).get_parser(prog_name)
parser.add_argument(
'name',
metavar='<STACK_NAME>',
metavar='<stack-name>',
help=_('Name of the stack to adopt')
)
parser.add_argument(
'-e', '--environment',
metavar='<FILE or URL>',
metavar='<environment>',
action='append',
help=_('Path to the environment. Can be specified multiple times')
)
parser.add_argument(
'--timeout',
metavar='<TIMEOUT>',
metavar='<timeout>',
type=int,
help=_('Stack creation timeout in minutes')
)
parser.add_argument(
'--adopt-file',
metavar='<FILE or URL>',
metavar='<adopt-file>',
required=True,
help=_('Path to adopt stack data file')
)
@ -694,7 +694,7 @@ class AdoptStack(show.ShowOne):
)
parser.add_argument(
'--parameter',
metavar='<KEY=VALUE>',
metavar='<key=value>',
action='append',
help=_('Parameter values used to create the stack. Can be '
'specified multiple times')
@ -749,12 +749,12 @@ class AbandonStack(format_utils.JsonFormat):
parser = super(AbandonStack, self).get_parser(prog_name)
parser.add_argument(
'stack',
metavar='<NAME or ID>',
metavar='<stack>',
help=_('Name or ID of stack to abandon')
)
parser.add_argument(
'--output-file',
metavar='<FILE>',
metavar='<output-file>',
help=_('File to output abandon results')
)
@ -793,12 +793,12 @@ class OutputShowStack(show.ShowOne):
parser = super(OutputShowStack, self).get_parser(prog_name)
parser.add_argument(
'stack',
metavar='<NAME or ID>',
metavar='<stack>',
help=_('Name or ID of stack to query')
)
parser.add_argument(
'output',
metavar='<OUTPUT NAME>',
metavar='<output>',
nargs='?',
default=None,
help=_('Name of an output to display')
@ -868,7 +868,7 @@ class OutputListStack(lister.Lister):
parser = super(OutputListStack, self).get_parser(prog_name)
parser.add_argument(
'stack',
metavar='<NAME or ID>',
metavar='<stack>',
help=_('Name or ID of stack to query')
)
return parser
@ -901,7 +901,7 @@ class TemplateShowStack(format_utils.YamlFormat):
parser = super(TemplateShowStack, self).get_parser(prog_name)
parser.add_argument(
'stack',
metavar='<NAME or ID>',
metavar='<stack>',
help=_('Name or ID of stack to query')
)
return parser

View File

@ -49,7 +49,7 @@ class FunctionList(lister.Lister):
parser = super(FunctionList, self).get_parser(prog_name)
parser.add_argument(
'template_version',
metavar='<TEMPLATE_VERSION>',
metavar='<template-version>',
help=_('Template version to get the functions for')
)