Merge "Improve help strings"

This commit is contained in:
Jenkins
2014-06-25 21:14:07 +00:00
committed by Gerrit Code Review
31 changed files with 255 additions and 251 deletions

View File

@@ -91,7 +91,7 @@ def find_resourceid_by_name_or_id(client, resource, name_or_id):
def add_show_list_common_argument(parser): def add_show_list_common_argument(parser):
parser.add_argument( parser.add_argument(
'-D', '--show-details', '-D', '--show-details',
help=_('Show detailed info'), help=_('Show detailed info.'),
action='store_true', action='store_true',
default=False, ) default=False, )
parser.add_argument( parser.add_argument(
@@ -117,7 +117,7 @@ def add_pagination_argument(parser):
'-P', '--page-size', '-P', '--page-size',
dest='page_size', metavar='SIZE', type=int, dest='page_size', metavar='SIZE', type=int,
help=_("Specify retrieve unit of each request, then split one request " help=_("Specify retrieve unit of each request, then split one request "
"to several requests"), "to several requests."),
default=None) default=None)
@@ -356,7 +356,7 @@ class NeutronCommand(command.OpenStackCommand):
parser = super(NeutronCommand, self).get_parser(prog_name) parser = super(NeutronCommand, self).get_parser(prog_name)
parser.add_argument( parser.add_argument(
'--request-format', '--request-format',
help=_('The xml or json request format'), help=_('The xml or json request format.'),
default='json', default='json',
choices=['json', 'xml', ], ) choices=['json', 'xml', ], )
parser.add_argument( parser.add_argument(
@@ -401,7 +401,7 @@ class CreateCommand(NeutronCommand, show.ShowOne):
parser = super(CreateCommand, self).get_parser(prog_name) parser = super(CreateCommand, self).get_parser(prog_name)
parser.add_argument( parser.add_argument(
'--tenant-id', metavar='TENANT_ID', '--tenant-id', metavar='TENANT_ID',
help=_('The owner tenant ID'), ) help=_('The owner tenant ID.'), )
parser.add_argument( parser.add_argument(
'--tenant_id', '--tenant_id',
help=argparse.SUPPRESS) help=argparse.SUPPRESS)
@@ -444,7 +444,7 @@ class UpdateCommand(NeutronCommand):
parser = super(UpdateCommand, self).get_parser(prog_name) parser = super(UpdateCommand, self).get_parser(prog_name)
parser.add_argument( parser.add_argument(
'id', metavar=self.resource.upper(), 'id', metavar=self.resource.upper(),
help=_('ID or name of %s to update') % self.resource) help=_('ID or name of %s to update.') % self.resource)
self.add_known_arguments(parser) self.add_known_arguments(parser)
return parser return parser
@@ -491,9 +491,9 @@ class DeleteCommand(NeutronCommand):
def get_parser(self, prog_name): def get_parser(self, prog_name):
parser = super(DeleteCommand, self).get_parser(prog_name) parser = super(DeleteCommand, self).get_parser(prog_name)
if self.allow_names: if self.allow_names:
help_str = _('ID or name of %s to delete') help_str = _('ID or name of %s to delete.')
else: else:
help_str = _('ID of %s to delete') help_str = _('ID of %s to delete.')
parser.add_argument( parser.add_argument(
'id', metavar=self.resource.upper(), 'id', metavar=self.resource.upper(),
help=help_str % self.resource) help=help_str % self.resource)
@@ -631,9 +631,9 @@ class ShowCommand(NeutronCommand, show.ShowOne):
parser = super(ShowCommand, self).get_parser(prog_name) parser = super(ShowCommand, self).get_parser(prog_name)
add_show_list_common_argument(parser) add_show_list_common_argument(parser)
if self.allow_names: if self.allow_names:
help_str = _('ID or name of %s to look up') help_str = _('ID or name of %s to look up.')
else: else:
help_str = _('ID of %s to look up') help_str = _('ID of %s to look up.')
parser.add_argument( parser.add_argument(
'id', metavar=self.resource.upper(), 'id', metavar=self.resource.upper(),
help=help_str % self.resource) help=help_str % self.resource)

View File

@@ -36,10 +36,10 @@ class AddNetworkToDhcpAgent(neutronV20.NeutronCommand):
parser = super(AddNetworkToDhcpAgent, self).get_parser(prog_name) parser = super(AddNetworkToDhcpAgent, self).get_parser(prog_name)
parser.add_argument( parser.add_argument(
'dhcp_agent', 'dhcp_agent',
help=_('ID of the DHCP agent')) help=_('ID of the DHCP agent.'))
parser.add_argument( parser.add_argument(
'network', 'network',
help=_('Network to add')) help=_('Network to add.'))
return parser return parser
def run(self, parsed_args): def run(self, parsed_args):
@@ -62,10 +62,10 @@ class RemoveNetworkFromDhcpAgent(neutronV20.NeutronCommand):
parser = super(RemoveNetworkFromDhcpAgent, self).get_parser(prog_name) parser = super(RemoveNetworkFromDhcpAgent, self).get_parser(prog_name)
parser.add_argument( parser.add_argument(
'dhcp_agent', 'dhcp_agent',
help=_('ID of the DHCP agent')) help=_('ID of the DHCP agent.'))
parser.add_argument( parser.add_argument(
'network', 'network',
help=_('Network to remove')) help=_('Network to remove.'))
return parser return parser
def run(self, parsed_args): def run(self, parsed_args):
@@ -91,7 +91,7 @@ class ListNetworksOnDhcpAgent(network.ListNetwork):
self).get_parser(prog_name) self).get_parser(prog_name)
parser.add_argument( parser.add_argument(
'dhcp_agent', 'dhcp_agent',
help=_('ID of the DHCP agent')) help=_('ID of the DHCP agent.'))
return parser return parser
def call_server(self, neutron_client, search_opts, parsed_args): def call_server(self, neutron_client, search_opts, parsed_args):
@@ -114,7 +114,7 @@ class ListDhcpAgentsHostingNetwork(neutronV20.ListCommand):
self).get_parser(prog_name) self).get_parser(prog_name)
parser.add_argument( parser.add_argument(
'network', 'network',
help=_('Network to query')) help=_('Network to query.'))
return parser return parser
def extend_list(self, data, parsed_args): def extend_list(self, data, parsed_args):
@@ -139,10 +139,10 @@ class AddRouterToL3Agent(neutronV20.NeutronCommand):
parser = super(AddRouterToL3Agent, self).get_parser(prog_name) parser = super(AddRouterToL3Agent, self).get_parser(prog_name)
parser.add_argument( parser.add_argument(
'l3_agent', 'l3_agent',
help=_('ID of the L3 agent')) help=_('ID of the L3 agent.'))
parser.add_argument( parser.add_argument(
'router', 'router',
help=_('Router to add')) help=_('Router to add.'))
return parser return parser
def run(self, parsed_args): def run(self, parsed_args):
@@ -166,10 +166,10 @@ class RemoveRouterFromL3Agent(neutronV20.NeutronCommand):
parser = super(RemoveRouterFromL3Agent, self).get_parser(prog_name) parser = super(RemoveRouterFromL3Agent, self).get_parser(prog_name)
parser.add_argument( parser.add_argument(
'l3_agent', 'l3_agent',
help=_('ID of the L3 agent')) help=_('ID of the L3 agent.'))
parser.add_argument( parser.add_argument(
'router', 'router',
help=_('Router to remove')) help=_('Router to remove.'))
return parser return parser
def run(self, parsed_args): def run(self, parsed_args):
@@ -199,7 +199,7 @@ class ListRoutersOnL3Agent(neutronV20.ListCommand):
self).get_parser(prog_name) self).get_parser(prog_name)
parser.add_argument( parser.add_argument(
'l3_agent', 'l3_agent',
help=_('ID of the L3 agent to query')) help=_('ID of the L3 agent to query.'))
return parser return parser
def call_server(self, neutron_client, search_opts, parsed_args): def call_server(self, neutron_client, search_opts, parsed_args):
@@ -221,7 +221,7 @@ class ListL3AgentsHostingRouter(neutronV20.ListCommand):
parser = super(ListL3AgentsHostingRouter, parser = super(ListL3AgentsHostingRouter,
self).get_parser(prog_name) self).get_parser(prog_name)
parser.add_argument('router', parser.add_argument('router',
help=_('Router to query')) help=_('Router to query.'))
return parser return parser
def extend_list(self, data, parsed_args): def extend_list(self, data, parsed_args):
@@ -250,7 +250,7 @@ class ListPoolsOnLbaasAgent(neutronV20.ListCommand):
parser = super(ListPoolsOnLbaasAgent, self).get_parser(prog_name) parser = super(ListPoolsOnLbaasAgent, self).get_parser(prog_name)
parser.add_argument( parser.add_argument(
'lbaas_agent', 'lbaas_agent',
help=_('ID of the loadbalancer agent to query')) help=_('ID of the loadbalancer agent to query.'))
return parser return parser
def call_server(self, neutron_client, search_opts, parsed_args): def call_server(self, neutron_client, search_opts, parsed_args):
@@ -275,7 +275,7 @@ class GetLbaasAgentHostingPool(neutronV20.ListCommand):
parser = super(GetLbaasAgentHostingPool, parser = super(GetLbaasAgentHostingPool,
self).get_parser(prog_name) self).get_parser(prog_name)
parser.add_argument('pool', parser.add_argument('pool',
help=_('Pool to query')) help=_('Pool to query.'))
return parser return parser
def extend_list(self, data, parsed_args): def extend_list(self, data, parsed_args):

View File

@@ -44,16 +44,16 @@ class CreateCredential(neutronV20.CreateCommand):
def add_known_arguments(self, parser): def add_known_arguments(self, parser):
parser.add_argument( parser.add_argument(
'credential_name', 'credential_name',
help=_('Name/Ip address for Credential')) help=_('Name/IP address for credential.'))
parser.add_argument( parser.add_argument(
'credential_type', 'credential_type',
help=_('Type of the Credential')) help=_('Type of the credential.'))
parser.add_argument( parser.add_argument(
'--username', '--username',
help=_('Username for the credential')) help=_('Username for the credential.'))
parser.add_argument( parser.add_argument(
'--password', '--password',
help=_('Password for the credential')) help=_('Password for the credential.'))
def args2body(self, parsed_args): def args2body(self, parsed_args):
body = {'credential': { body = {'credential': {

View File

@@ -40,5 +40,5 @@ class ShowExt(cmd_base.ShowCommand):
cmd_base.add_show_list_common_argument(parser) cmd_base.add_show_list_common_argument(parser)
parser.add_argument( parser.add_argument(
'id', metavar='EXT-ALIAS', 'id', metavar='EXT-ALIAS',
help=_('The extension alias')) help=_('The extension alias.'))
return parser return parser

View File

@@ -24,7 +24,7 @@ from neutronclient.openstack.common.gettextutils import _
class ListFloatingIP(neutronV20.ListCommand): class ListFloatingIP(neutronV20.ListCommand):
"""List floating ips that belong to a given tenant.""" """List floating IPs that belong to a given tenant."""
resource = 'floatingip' resource = 'floatingip'
log = logging.getLogger(__name__ + '.ListFloatingIP') log = logging.getLogger(__name__ + '.ListFloatingIP')
@@ -35,7 +35,7 @@ class ListFloatingIP(neutronV20.ListCommand):
class ShowFloatingIP(neutronV20.ShowCommand): class ShowFloatingIP(neutronV20.ShowCommand):
"""Show information of a given floating ip.""" """Show information of a given floating IP."""
resource = 'floatingip' resource = 'floatingip'
log = logging.getLogger(__name__ + '.ShowFloatingIP') log = logging.getLogger(__name__ + '.ShowFloatingIP')
@@ -43,7 +43,7 @@ class ShowFloatingIP(neutronV20.ShowCommand):
class CreateFloatingIP(neutronV20.CreateCommand): class CreateFloatingIP(neutronV20.CreateCommand):
"""Create a floating ip for a given tenant.""" """Create a floating IP for a given tenant."""
resource = 'floatingip' resource = 'floatingip'
log = logging.getLogger(__name__ + '.CreateFloatingIP') log = logging.getLogger(__name__ + '.CreateFloatingIP')
@@ -51,17 +51,17 @@ class CreateFloatingIP(neutronV20.CreateCommand):
def add_known_arguments(self, parser): def add_known_arguments(self, parser):
parser.add_argument( parser.add_argument(
'floating_network_id', metavar='FLOATING_NETWORK', 'floating_network_id', metavar='FLOATING_NETWORK',
help=_('Network name or id to allocate floating IP from')) help=_('Network name or ID to allocate floating IP from.'))
parser.add_argument( parser.add_argument(
'--port-id', '--port-id',
help=_('ID of the port to be associated with the floatingip')) help=_('ID of the port to be associated with the floating IP.'))
parser.add_argument( parser.add_argument(
'--port_id', '--port_id',
help=argparse.SUPPRESS) help=argparse.SUPPRESS)
parser.add_argument( parser.add_argument(
'--fixed-ip-address', '--fixed-ip-address',
help=_('IP address on the port (only required if port has multiple' help=_('IP address on the port (only required if port has '
'IPs)')) 'multiple IPs).'))
parser.add_argument( parser.add_argument(
'--fixed_ip_address', '--fixed_ip_address',
help=argparse.SUPPRESS) help=argparse.SUPPRESS)
@@ -81,7 +81,7 @@ class CreateFloatingIP(neutronV20.CreateCommand):
class DeleteFloatingIP(neutronV20.DeleteCommand): class DeleteFloatingIP(neutronV20.DeleteCommand):
"""Delete a given floating ip.""" """Delete a given floating IP."""
log = logging.getLogger(__name__ + '.DeleteFloatingIP') log = logging.getLogger(__name__ + '.DeleteFloatingIP')
resource = 'floatingip' resource = 'floatingip'
@@ -89,7 +89,7 @@ class DeleteFloatingIP(neutronV20.DeleteCommand):
class AssociateFloatingIP(neutronV20.NeutronCommand): class AssociateFloatingIP(neutronV20.NeutronCommand):
"""Create a mapping between a floating ip and a fixed ip.""" """Create a mapping between a floating IP and a fixed IP."""
api = 'network' api = 'network'
log = logging.getLogger(__name__ + '.AssociateFloatingIP') log = logging.getLogger(__name__ + '.AssociateFloatingIP')
@@ -99,15 +99,15 @@ class AssociateFloatingIP(neutronV20.NeutronCommand):
parser = super(AssociateFloatingIP, self).get_parser(prog_name) parser = super(AssociateFloatingIP, self).get_parser(prog_name)
parser.add_argument( parser.add_argument(
'floatingip_id', metavar='FLOATINGIP_ID', 'floatingip_id', metavar='FLOATINGIP_ID',
help=_('ID of the floating IP to associate')) help=_('ID of the floating IP to associate.'))
parser.add_argument( parser.add_argument(
'port_id', metavar='PORT', 'port_id', metavar='PORT',
help=_('ID or name of the port to be associated with the ' help=_('ID or name of the port to be associated with the '
'floatingip')) 'floating IP.'))
parser.add_argument( parser.add_argument(
'--fixed-ip-address', '--fixed-ip-address',
help=_('IP address on the port (only required if port has multiple' help=_('IP address on the port (only required if port has '
'IPs)')) 'multiple IPs).'))
parser.add_argument( parser.add_argument(
'--fixed_ip_address', '--fixed_ip_address',
help=argparse.SUPPRESS) help=argparse.SUPPRESS)
@@ -124,12 +124,12 @@ class AssociateFloatingIP(neutronV20.NeutronCommand):
update_dict['fixed_ip_address'] = parsed_args.fixed_ip_address update_dict['fixed_ip_address'] = parsed_args.fixed_ip_address
neutron_client.update_floatingip(parsed_args.floatingip_id, neutron_client.update_floatingip(parsed_args.floatingip_id,
{'floatingip': update_dict}) {'floatingip': update_dict})
print(_('Associated floatingip %s') % parsed_args.floatingip_id, print(_('Associated floating IP %s') % parsed_args.floatingip_id,
file=self.app.stdout) file=self.app.stdout)
class DisassociateFloatingIP(neutronV20.NeutronCommand): class DisassociateFloatingIP(neutronV20.NeutronCommand):
"""Remove a mapping from a floating ip to a fixed ip. """Remove a mapping from a floating IP to a fixed IP.
""" """
api = 'network' api = 'network'
@@ -140,7 +140,7 @@ class DisassociateFloatingIP(neutronV20.NeutronCommand):
parser = super(DisassociateFloatingIP, self).get_parser(prog_name) parser = super(DisassociateFloatingIP, self).get_parser(prog_name)
parser.add_argument( parser.add_argument(
'floatingip_id', metavar='FLOATINGIP_ID', 'floatingip_id', metavar='FLOATINGIP_ID',
help=_('ID of the floating IP to associate')) help=_('ID of the floating IP to associate.'))
return parser return parser
def run(self, parsed_args): def run(self, parsed_args):
@@ -149,5 +149,5 @@ class DisassociateFloatingIP(neutronV20.NeutronCommand):
neutron_client.format = parsed_args.request_format neutron_client.format = parsed_args.request_format
neutron_client.update_floatingip(parsed_args.floatingip_id, neutron_client.update_floatingip(parsed_args.floatingip_id,
{'floatingip': {'port_id': None}}) {'floatingip': {'port_id': None}})
print(_('Disassociated floatingip %s') % parsed_args.floatingip_id, print(_('Disassociated floating IP %s') % parsed_args.floatingip_id,
file=self.app.stdout) file=self.app.stdout)

View File

@@ -50,23 +50,23 @@ class CreateFirewall(neutronv20.CreateCommand):
def add_known_arguments(self, parser): def add_known_arguments(self, parser):
parser.add_argument( parser.add_argument(
'firewall_policy_id', metavar='POLICY', 'firewall_policy_id', metavar='POLICY',
help=_('Firewall policy id')) help=_('Firewall policy ID.'))
parser.add_argument( parser.add_argument(
'--name', '--name',
help=_('Name for the firewall')) help=_('Name for the firewall.'))
parser.add_argument( parser.add_argument(
'--description', '--description',
help=_('Description for the firewall rule')) help=_('Description for the firewall rule.'))
parser.add_argument( parser.add_argument(
'--shared', '--shared',
action='store_true', action='store_true',
help=_('Set shared to True (default False)'), help=_('Set shared to True (default is False).'),
default=argparse.SUPPRESS) default=argparse.SUPPRESS)
parser.add_argument( parser.add_argument(
'--admin-state-down', '--admin-state-down',
dest='admin_state', dest='admin_state',
action='store_false', action='store_false',
help=_('Set admin state up to false')) help=_('Set admin state up to false.'))
def args2body(self, parsed_args): def args2body(self, parsed_args):
_policy_id = neutronv20.find_resourceid_by_name_or_id( _policy_id = neutronv20.find_resourceid_by_name_or_id(

View File

@@ -64,15 +64,15 @@ class CreateFirewallPolicy(neutronv20.CreateCommand):
parser.add_argument( parser.add_argument(
'name', 'name',
metavar='NAME', metavar='NAME',
help=_('Name for the firewall policy')) help=_('Name for the firewall policy.'))
parser.add_argument( parser.add_argument(
'--description', '--description',
help=_('Description for the firewall policy')) help=_('Description for the firewall policy.'))
parser.add_argument( parser.add_argument(
'--shared', '--shared',
dest='shared', dest='shared',
action='store_true', action='store_true',
help=_('To create a shared policy'), help=_('Create a shared policy.'),
default=argparse.SUPPRESS) default=argparse.SUPPRESS)
parser.add_argument( parser.add_argument(
'--firewall-rules', type=string.split, '--firewall-rules', type=string.split,
@@ -81,7 +81,7 @@ class CreateFirewallPolicy(neutronv20.CreateCommand):
parser.add_argument( parser.add_argument(
'--audited', '--audited',
action='store_true', action='store_true',
help=_('To set audited to True'), help=_('Sets audited to True.'),
default=argparse.SUPPRESS) default=argparse.SUPPRESS)
def args2body(self, parsed_args): def args2body(self, parsed_args):
@@ -156,15 +156,15 @@ class FirewallPolicyInsertRule(neutronv20.UpdateCommand):
parser.add_argument( parser.add_argument(
'--insert-before', '--insert-before',
metavar='FIREWALL_RULE', metavar='FIREWALL_RULE',
help=_('Insert before this rule')) help=_('Insert before this rule.'))
parser.add_argument( parser.add_argument(
'--insert-after', '--insert-after',
metavar='FIREWALL_RULE', metavar='FIREWALL_RULE',
help=_('Insert after this rule')) help=_('Insert after this rule.'))
parser.add_argument( parser.add_argument(
'firewall_rule_id', 'firewall_rule_id',
metavar='FIREWALL_RULE', metavar='FIREWALL_RULE',
help=_('New rule to insert')) help=_('New rule to insert.'))
self.add_known_arguments(parser) self.add_known_arguments(parser)
return parser return parser
@@ -205,7 +205,7 @@ class FirewallPolicyRemoveRule(neutronv20.UpdateCommand):
parser.add_argument( parser.add_argument(
'firewall_rule_id', 'firewall_rule_id',
metavar='FIREWALL_RULE', metavar='FIREWALL_RULE',
help=_('Firewall rule to remove from policy')) help=_('Firewall rule to remove from policy.'))
self.add_known_arguments(parser) self.add_known_arguments(parser)
return parser return parser

View File

@@ -76,43 +76,44 @@ class CreateFirewallRule(neutronv20.CreateCommand):
def add_known_arguments(self, parser): def add_known_arguments(self, parser):
parser.add_argument( parser.add_argument(
'--name', '--name',
help=_('Name for the firewall rule')) help=_('Name for the firewall rule.'))
parser.add_argument( parser.add_argument(
'--description', '--description',
help=_('Description for the firewall rule')) help=_('Description for the firewall rule.'))
parser.add_argument( parser.add_argument(
'--shared', '--shared',
dest='shared', dest='shared',
action='store_true', action='store_true',
help=_('Set shared to True (default False)'), help=_('Set shared to True (default is False).'),
default=argparse.SUPPRESS) default=argparse.SUPPRESS)
parser.add_argument( parser.add_argument(
'--source-ip-address', '--source-ip-address',
help=_('Source ip address or subnet')) help=_('Source IP address or subnet.'))
parser.add_argument( parser.add_argument(
'--destination-ip-address', '--destination-ip-address',
help=_('Destination ip address or subnet')) help=_('Destination IP address or subnet.'))
parser.add_argument( parser.add_argument(
'--source-port', '--source-port',
help=_('Source port (integer in [1, 65535] or range in a:b)')) help=_('Source port (integer in [1, 65535] or range in a:b).'))
parser.add_argument( parser.add_argument(
'--destination-port', '--destination-port',
help=_('Destination port (integer in [1, 65535] or range in a:b)')) help=_('Destination port (integer in [1, 65535] or range in '
'a:b).'))
parser.add_argument( parser.add_argument(
'--disabled', '--disabled',
dest='enabled', dest='enabled',
action='store_false', action='store_false',
help=_('To disable this rule'), help=_('To disable this rule.'),
default=argparse.SUPPRESS) default=argparse.SUPPRESS)
parser.add_argument( parser.add_argument(
'--protocol', choices=['tcp', 'udp', 'icmp', 'any'], '--protocol', choices=['tcp', 'udp', 'icmp', 'any'],
required=True, required=True,
help=_('Protocol for the firewall rule')) help=_('Protocol for the firewall rule.'))
parser.add_argument( parser.add_argument(
'--action', '--action',
required=True, required=True,
choices=['allow', 'deny'], choices=['allow', 'deny'],
help=_('Action for the firewall rule')) help=_('Action for the firewall rule.'))
def args2body(self, parsed_args): def args2body(self, parsed_args):
body = { body = {
@@ -140,7 +141,7 @@ class UpdateFirewallRule(neutronv20.UpdateCommand):
parser.add_argument( parser.add_argument(
'--protocol', choices=['tcp', 'udp', 'icmp', 'any'], '--protocol', choices=['tcp', 'udp', 'icmp', 'any'],
required=False, required=False,
help=_('Protocol for the firewall rule')) help=_('Protocol for the firewall rule.'))
def args2body(self, parsed_args): def args2body(self, parsed_args):
body = { body = {

View File

@@ -51,7 +51,7 @@ class CreateHealthMonitor(neutronV20.CreateCommand):
parser.add_argument( parser.add_argument(
'--admin-state-down', '--admin-state-down',
dest='admin_state', action='store_false', dest='admin_state', action='store_false',
help=_('Set admin state up to false')) help=_('Set admin state up to false.'))
parser.add_argument( parser.add_argument(
'--expected-codes', '--expected-codes',
help=_('The list of HTTP status codes expected in ' help=_('The list of HTTP status codes expected in '
@@ -68,7 +68,7 @@ class CreateHealthMonitor(neutronV20.CreateCommand):
'--url-path', '--url-path',
help=_('The HTTP path used in the HTTP request used by the monitor' help=_('The HTTP path used in the HTTP request used by the monitor'
' to test a member health. This must be a string ' ' to test a member health. This must be a string '
'beginning with a / (forward slash)')) 'beginning with a / (forward slash).'))
parser.add_argument( parser.add_argument(
'--delay', '--delay',
required=True, required=True,
@@ -87,7 +87,7 @@ class CreateHealthMonitor(neutronV20.CreateCommand):
parser.add_argument( parser.add_argument(
'--type', '--type',
required=True, choices=['PING', 'TCP', 'HTTP', 'HTTPS'], required=True, choices=['PING', 'TCP', 'HTTP', 'HTTPS'],
help=_('One of predefined health monitor types')) help=_('One of the predefined health monitor types.'))
def args2body(self, parsed_args): def args2body(self, parsed_args):
body = { body = {
@@ -130,10 +130,10 @@ class AssociateHealthMonitor(neutronV20.NeutronCommand):
parser = super(AssociateHealthMonitor, self).get_parser(prog_name) parser = super(AssociateHealthMonitor, self).get_parser(prog_name)
parser.add_argument( parser.add_argument(
'health_monitor_id', metavar='HEALTH_MONITOR_ID', 'health_monitor_id', metavar='HEALTH_MONITOR_ID',
help=_('Health monitor to associate')) help=_('Health monitor to associate.'))
parser.add_argument( parser.add_argument(
'pool_id', metavar='POOL', 'pool_id', metavar='POOL',
help=_('ID of the pool to be associated with the health monitor')) help=_('ID of the pool to be associated with the health monitor.'))
return parser return parser
def run(self, parsed_args): def run(self, parsed_args):
@@ -158,10 +158,10 @@ class DisassociateHealthMonitor(neutronV20.NeutronCommand):
parser = super(DisassociateHealthMonitor, self).get_parser(prog_name) parser = super(DisassociateHealthMonitor, self).get_parser(prog_name)
parser.add_argument( parser.add_argument(
'health_monitor_id', metavar='HEALTH_MONITOR_ID', 'health_monitor_id', metavar='HEALTH_MONITOR_ID',
help=_('Health monitor to associate')) help=_('Health monitor to associate.'))
parser.add_argument( parser.add_argument(
'pool_id', metavar='POOL', 'pool_id', metavar='POOL',
help=_('ID of the pool to be associated with the health monitor')) help=_('ID of the pool to be associated with the health monitor.'))
return parser return parser
def run(self, parsed_args): def run(self, parsed_args):

View File

@@ -50,14 +50,14 @@ class CreateMember(neutronV20.CreateCommand):
def add_known_arguments(self, parser): def add_known_arguments(self, parser):
parser.add_argument( parser.add_argument(
'pool_id', metavar='POOL', 'pool_id', metavar='POOL',
help=_('Pool id or name this vip belongs to')) help=_('Pool ID or name this vip belongs to.'))
parser.add_argument( parser.add_argument(
'--admin-state-down', '--admin-state-down',
dest='admin_state', action='store_false', dest='admin_state', action='store_false',
help=_('Set admin state up to false')) help=_('Set admin state up to false.'))
parser.add_argument( parser.add_argument(
'--weight', '--weight',
help=_('Weight of pool member in the pool (default:1, [0..256])')) help=_('Weight of pool member in the pool (default:1, [0..256]).'))
parser.add_argument( parser.add_argument(
'--address', '--address',
required=True, required=True,

View File

@@ -55,33 +55,33 @@ class CreatePool(neutronV20.CreateCommand):
parser.add_argument( parser.add_argument(
'--admin-state-down', '--admin-state-down',
dest='admin_state', action='store_false', dest='admin_state', action='store_false',
help=_('Set admin state up to false')) help=_('Set admin state up to false.'))
parser.add_argument( parser.add_argument(
'--description', '--description',
help=_('Description of the pool')) help=_('Description of the pool.'))
parser.add_argument( parser.add_argument(
'--lb-method', '--lb-method',
required=True, required=True,
choices=['ROUND_ROBIN', 'LEAST_CONNECTIONS', 'SOURCE_IP'], choices=['ROUND_ROBIN', 'LEAST_CONNECTIONS', 'SOURCE_IP'],
help=_('The algorithm used to distribute load between the members ' help=_('The algorithm used to distribute load between the members '
'of the pool')) 'of the pool.'))
parser.add_argument( parser.add_argument(
'--name', '--name',
required=True, required=True,
help=_('The name of the pool')) help=_('The name of the pool.'))
parser.add_argument( parser.add_argument(
'--protocol', '--protocol',
required=True, required=True,
choices=['HTTP', 'HTTPS', 'TCP'], choices=['HTTP', 'HTTPS', 'TCP'],
help=_('Protocol for balancing')) help=_('Protocol for balancing.'))
parser.add_argument( parser.add_argument(
'--subnet-id', metavar='SUBNET', '--subnet-id', metavar='SUBNET',
required=True, required=True,
help=_('The subnet on which the members of the pool will be ' help=_('The subnet on which the members of the pool will be '
'located')) 'located.'))
parser.add_argument( parser.add_argument(
'--provider', '--provider',
help=_('Provider name of loadbalancer service')) help=_('Provider name of loadbalancer service.'))
def args2body(self, parsed_args): def args2body(self, parsed_args):
_subnet_id = neutronV20.find_resourceid_by_name_or_id( _subnet_id = neutronV20.find_resourceid_by_name_or_id(

View File

@@ -49,38 +49,38 @@ class CreateVip(neutronV20.CreateCommand):
def add_known_arguments(self, parser): def add_known_arguments(self, parser):
parser.add_argument( parser.add_argument(
'pool_id', metavar='POOL', 'pool_id', metavar='POOL',
help=_('Pool id or name this vip belongs to')) help=_('Pool ID or name this vip belongs to.'))
parser.add_argument( parser.add_argument(
'--address', '--address',
help=_('IP address of the vip')) help=_('IP address of the vip.'))
parser.add_argument( parser.add_argument(
'--admin-state-down', '--admin-state-down',
dest='admin_state', action='store_false', dest='admin_state', action='store_false',
help=_('Set admin state up to false')) help=_('Set admin state up to false.'))
parser.add_argument( parser.add_argument(
'--connection-limit', '--connection-limit',
help=_('The maximum number of connections per second allowed for ' help=_('The maximum number of connections per second allowed for '
'the vip. Positive integer or -1 for unlimited (default)')) 'the vip. Positive integer or -1 for unlimited (default).'))
parser.add_argument( parser.add_argument(
'--description', '--description',
help=_('Description of the vip')) help=_('Description of the vip.'))
parser.add_argument( parser.add_argument(
'--name', '--name',
required=True, required=True,
help=_('Name of the vip')) help=_('Name of the vip.'))
parser.add_argument( parser.add_argument(
'--protocol-port', '--protocol-port',
required=True, required=True,
help=_('TCP port on which to listen for client traffic that is ' help=_('TCP port on which to listen for client traffic that is '
'associated with the vip address')) 'associated with the vip address.'))
parser.add_argument( parser.add_argument(
'--protocol', '--protocol',
required=True, choices=['TCP', 'HTTP', 'HTTPS'], required=True, choices=['TCP', 'HTTP', 'HTTPS'],
help=_('Protocol for balancing')) help=_('Protocol for balancing.'))
parser.add_argument( parser.add_argument(
'--subnet-id', metavar='SUBNET', '--subnet-id', metavar='SUBNET',
required=True, required=True,
help=_('The subnet on which to allocate the vip address')) help=_('The subnet on which to allocate the vip address.'))
def args2body(self, parsed_args): def args2body(self, parsed_args):
_pool_id = neutronV20.find_resourceid_by_name_or_id( _pool_id = neutronV20.find_resourceid_by_name_or_id(

View File

@@ -47,14 +47,14 @@ class CreateMeteringLabel(neutronv20.CreateCommand):
def add_known_arguments(self, parser): def add_known_arguments(self, parser):
parser.add_argument( parser.add_argument(
'name', metavar='NAME', 'name', metavar='NAME',
help=_('Name of metering label to create')) help=_('Name of metering label to create.'))
parser.add_argument( parser.add_argument(
'--description', '--description',
help=_('Description of metering label to create')) help=_('Description of metering label to create.'))
parser.add_argument( parser.add_argument(
'--shared', '--shared',
action='store_true', action='store_true',
help=_('Set the label as shared')) help=_('Set the label as shared.'))
def args2body(self, parsed_args): def args2body(self, parsed_args):
body = {'metering_label': { body = {'metering_label': {
@@ -105,18 +105,18 @@ class CreateMeteringLabelRule(neutronv20.CreateCommand):
def add_known_arguments(self, parser): def add_known_arguments(self, parser):
parser.add_argument( parser.add_argument(
'label_id', metavar='LABEL', 'label_id', metavar='LABEL',
help=_('Id or Name of the label')) help=_('Id or Name of the label.'))
parser.add_argument( parser.add_argument(
'remote_ip_prefix', metavar='REMOTE_IP_PREFIX', 'remote_ip_prefix', metavar='REMOTE_IP_PREFIX',
help=_('CIDR to match on')) help=_('CIDR to match on.'))
parser.add_argument( parser.add_argument(
'--direction', '--direction',
default='ingress', choices=['ingress', 'egress'], default='ingress', choices=['ingress', 'egress'],
help=_('Direction of traffic, default:ingress')) help=_('Direction of traffic, default: ingress.'))
parser.add_argument( parser.add_argument(
'--excluded', '--excluded',
action='store_true', action='store_true',
help=_('Exclude this cidr from the label, default:not excluded')) help=_('Exclude this CIDR from the label, default: not excluded.'))
def args2body(self, parsed_args): def args2body(self, parsed_args):
neutron_client = self.get_client() neutron_client = self.get_client()

View File

@@ -45,7 +45,7 @@ class CreateNetPartition(CreateCommand):
def add_known_arguments(self, parser): def add_known_arguments(self, parser):
parser.add_argument( parser.add_argument(
'name', metavar='name', 'name', metavar='name',
help='Name of NetPartition to create') help='Name of netpartition to create.')
def args2body(self, parsed_args): def args2body(self, parsed_args):
body = {'net_partition': {'name': parsed_args.name}, } body = {'net_partition': {'name': parsed_args.name}, }

View File

@@ -114,7 +114,7 @@ class CreateNetwork(neutronV20.CreateCommand):
parser.add_argument( parser.add_argument(
'--admin-state-down', '--admin-state-down',
dest='admin_state', action='store_false', dest='admin_state', action='store_false',
help=_('Set Admin State Up to false')) help=_('Set admin state up to false.'))
parser.add_argument( parser.add_argument(
'--admin_state_down', '--admin_state_down',
dest='admin_state', action='store_false', dest='admin_state', action='store_false',
@@ -122,11 +122,11 @@ class CreateNetwork(neutronV20.CreateCommand):
parser.add_argument( parser.add_argument(
'--shared', '--shared',
action='store_true', action='store_true',
help=_('Set the network as shared'), help=_('Set the network as shared.'),
default=argparse.SUPPRESS) default=argparse.SUPPRESS)
parser.add_argument( parser.add_argument(
'name', metavar='NAME', 'name', metavar='NAME',
help=_('Name of network to create')) help=_('Name of network to create.'))
def args2body(self, parsed_args): def args2body(self, parsed_args):
body = {'network': { body = {'network': {

View File

@@ -53,23 +53,23 @@ class CreateNetworkProfile(neutronV20.CreateCommand):
def add_known_arguments(self, parser): def add_known_arguments(self, parser):
parser.add_argument('name', parser.add_argument('name',
help=_('Name for Network Profile')) help=_('Name for network profile.'))
parser.add_argument('segment_type', parser.add_argument('segment_type',
choices=SEGMENT_TYPE_CHOICES, choices=SEGMENT_TYPE_CHOICES,
help='Segment type') help='Segment type.')
# TODO(Abhishek): Check on sub-type choices depending on segment_type # TODO(Abhishek): Check on sub-type choices depending on segment_type
parser.add_argument('--sub_type', parser.add_argument('--sub_type',
help=_('Sub-type for the segment. Available sub-' help=_('Sub-type for the segment. Available sub-'
'types for overlay segments: native, enhanced; ' 'types for overlay segments: native, enhanced; '
'For trunk segments: vlan, overlay.')) 'For trunk segments: vlan, overlay.'))
parser.add_argument('--segment_range', parser.add_argument('--segment_range',
help=_('Range for the Segment')) help=_('Range for the segment.'))
parser.add_argument('--physical_network', parser.add_argument('--physical_network',
help=_('Name for the Physical Network')) help=_('Name for the physical network.'))
parser.add_argument('--multicast_ip_range', parser.add_argument('--multicast_ip_range',
help=_('Multicast IPv4 Range')) help=_('Multicast IPv4 range.'))
parser.add_argument("--add-tenant", parser.add_argument("--add-tenant",
help=_("Add tenant to the network profile")) help=_("Add tenant to the network profile."))
def args2body(self, parsed_args): def args2body(self, parsed_args):
body = {'network_profile': {'name': parsed_args.name}} body = {'network_profile': {'name': parsed_args.name}}
@@ -118,7 +118,7 @@ class UpdateNetworkProfileV2(neutronV20.NeutronCommand):
def get_parser(self, prog_name): def get_parser(self, prog_name):
parser = super(UpdateNetworkProfileV2, self).get_parser(prog_name) parser = super(UpdateNetworkProfileV2, self).get_parser(prog_name)
parser.add_argument("--remove-tenant", parser.add_argument("--remove-tenant",
help="Remove tenant from the network profile") help="Remove tenant from the network profile.")
return parser return parser
def run(self, parsed_args): def run(self, parsed_args):

View File

@@ -26,15 +26,15 @@ GW_RESOURCE = 'network_gateway'
DEV_RESOURCE = 'gateway_device' DEV_RESOURCE = 'gateway_device'
CONNECTOR_TYPE_HELP = _("Type of the transport zone connector to use for this " CONNECTOR_TYPE_HELP = _("Type of the transport zone connector to use for this "
"device. Valid values are gre, stt, ipsecgre, " "device. Valid values are gre, stt, ipsecgre, "
"ipsecstt, and bridge. Defaults to stt") "ipsecstt, and bridge. Defaults to stt.")
CONNECTOR_IP_HELP = _("IP address for this device's transport connector. " CONNECTOR_IP_HELP = _("IP address for this device's transport connector. "
"It must correspond to the IP address of the interface " "It must correspond to the IP address of the interface "
"used for tenant traffic on the NSX gateway node") "used for tenant traffic on the NSX gateway node.")
CLIENT_CERT_HELP = _("PEM certificate used by the NSX gateway transport node " CLIENT_CERT_HELP = _("PEM certificate used by the NSX gateway transport node "
"to authenticate with the NSX controller") "to authenticate with the NSX controller.")
CLIENT_CERT_FILE_HELP = _("File containing the PEM certificate used by the " CLIENT_CERT_FILE_HELP = _("File containing the PEM certificate used by the "
"NSX gateway transport node to authenticate with " "NSX gateway transport node to authenticate with "
"the NSX controller") "the NSX controller.")
class ListGatewayDevice(neutronV20.ListCommand): class ListGatewayDevice(neutronV20.ListCommand):
@@ -85,7 +85,7 @@ class CreateGatewayDevice(neutronV20.CreateCommand):
def add_known_arguments(self, parser): def add_known_arguments(self, parser):
parser.add_argument( parser.add_argument(
'name', metavar='NAME', 'name', metavar='NAME',
help='Name of network gateway device to create') help='Name of network gateway device to create.')
parser.add_argument( parser.add_argument(
'--connector-type', '--connector-type',
default='stt', default='stt',
@@ -119,7 +119,7 @@ class UpdateGatewayDevice(neutronV20.UpdateCommand):
def add_known_arguments(self, parser): def add_known_arguments(self, parser):
parser.add_argument( parser.add_argument(
'--name', metavar='NAME', '--name', metavar='NAME',
help='New name for network gateway device') help='New name for network gateway device.')
parser.add_argument( parser.add_argument(
'--connector-type', '--connector-type',
required=False, required=False,
@@ -174,12 +174,12 @@ class CreateNetworkGateway(neutronV20.CreateCommand):
def add_known_arguments(self, parser): def add_known_arguments(self, parser):
parser.add_argument( parser.add_argument(
'name', metavar='NAME', 'name', metavar='NAME',
help=_('Name of network gateway to create')) help=_('Name of network gateway to create.'))
parser.add_argument( parser.add_argument(
'--device', metavar='id=ID,interface_name=NAME_OR_ID', '--device', metavar='id=ID,interface_name=NAME_OR_ID',
action='append', action='append',
help=_('Device info for this gateway. You can repeat this ' help=_('Device info for this gateway. You can repeat this '
'option for multiple devices for HA gateways')) 'option for multiple devices for HA gateways.'))
def args2body(self, parsed_args): def args2body(self, parsed_args):
body = {self.resource: { body = {self.resource: {
@@ -219,18 +219,18 @@ class NetworkGatewayInterfaceCommand(neutronV20.NeutronCommand):
self).get_parser(prog_name) self).get_parser(prog_name)
parser.add_argument( parser.add_argument(
'net_gateway_id', metavar='NET-GATEWAY-ID', 'net_gateway_id', metavar='NET-GATEWAY-ID',
help=_('ID of the network gateway')) help=_('ID of the network gateway.'))
parser.add_argument( parser.add_argument(
'network_id', metavar='NETWORK-ID', 'network_id', metavar='NETWORK-ID',
help=_('ID of the internal network to connect on the gateway')) help=_('ID of the internal network to connect on the gateway.'))
parser.add_argument( parser.add_argument(
'--segmentation-type', '--segmentation-type',
help=_('L2 segmentation strategy on the external side of ' help=_('L2 segmentation strategy on the external side of '
'the gateway (e.g.: VLAN, FLAT)')) 'the gateway (e.g.: VLAN, FLAT).'))
parser.add_argument( parser.add_argument(
'--segmentation-id', '--segmentation-id',
help=_('Identifier for the L2 segment on the external side ' help=_('Identifier for the L2 segment on the external side '
'of the gateway')) 'of the gateway.'))
return parser return parser
def retrieve_ids(self, client, args): def retrieve_ids(self, client, args):

View File

@@ -45,24 +45,24 @@ class CreateQoSQueue(neutronV20.CreateCommand):
def add_known_arguments(self, parser): def add_known_arguments(self, parser):
parser.add_argument( parser.add_argument(
'name', metavar='NAME', 'name', metavar='NAME',
help=_('Name of queue')) help=_('Name of queue.'))
parser.add_argument( parser.add_argument(
'--min', '--min',
help=_('min-rate')), help=_('Minimum rate.')),
parser.add_argument( parser.add_argument(
'--max', '--max',
help=_('max-rate')), help=_('Maximum rate.')),
parser.add_argument( parser.add_argument(
'--qos-marking', '--qos-marking',
help=_('QOS marking untrusted/trusted')), help=_('QOS marking as untrusted or trusted.')),
parser.add_argument( parser.add_argument(
'--default', '--default',
default=False, default=False,
help=_('If true all ports created with be the size of this queue' help=_('If true all created ports will be the size of this queue, '
'if queue is not specified')), 'if queue is not specified')),
parser.add_argument( parser.add_argument(
'--dscp', '--dscp',
help=_('Differentiated Services Code Point')), help=_('Differentiated Services Code Point.')),
def args2body(self, parsed_args): def args2body(self, parsed_args):
params = {'name': parsed_args.name, params = {'name': parsed_args.name,

View File

@@ -58,9 +58,9 @@ class UpdatePolicyProfileV2(neutronV20.UpdateCommand):
def get_parser(self, prog_name): def get_parser(self, prog_name):
parser = super(UpdatePolicyProfileV2, self).get_parser(prog_name) parser = super(UpdatePolicyProfileV2, self).get_parser(prog_name)
parser.add_argument("--add-tenant", parser.add_argument("--add-tenant",
help=_("Add tenant to the policy profile")) help=_("Add tenant to the policy profile."))
parser.add_argument("--remove-tenant", parser.add_argument("--remove-tenant",
help=_("Remove tenant from the policy profile")) help=_("Remove tenant from the policy profile."))
return parser return parser
def run(self, parsed_args): def run(self, parsed_args):

View File

@@ -55,7 +55,7 @@ class ListRouterPort(neutronV20.ListCommand):
parser = super(ListRouterPort, self).get_parser(prog_name) parser = super(ListRouterPort, self).get_parser(prog_name)
parser.add_argument( parser.add_argument(
'id', metavar='router', 'id', metavar='router',
help=_('ID or name of router to look up')) help=_('ID or name of router to look up.'))
return parser return parser
def get_data(self, parsed_args): def get_data(self, parsed_args):
@@ -85,7 +85,7 @@ class UpdatePortSecGroupMixin(object):
group_sg.add_argument( group_sg.add_argument(
'--no-security-groups', '--no-security-groups',
action='store_true', action='store_true',
help=_('Associate no security groups with the port')) help=_('Associate no security groups with the port.'))
def _resolv_sgid(self, secgroup): def _resolv_sgid(self, secgroup):
return neutronV20.find_resourceid_by_name_or_id( return neutronV20.find_resourceid_by_name_or_id(
@@ -149,24 +149,24 @@ class CreatePort(neutronV20.CreateCommand, UpdatePortSecGroupMixin,
def add_known_arguments(self, parser): def add_known_arguments(self, parser):
parser.add_argument( parser.add_argument(
'--name', '--name',
help=_('Name of this port')) help=_('Name of this port.'))
parser.add_argument( parser.add_argument(
'--admin-state-down', '--admin-state-down',
dest='admin_state', action='store_false', dest='admin_state', action='store_false',
help=_('Set admin state up to false')) help=_('Set admin state up to false.'))
parser.add_argument( parser.add_argument(
'--admin_state_down', '--admin_state_down',
dest='admin_state', action='store_false', dest='admin_state', action='store_false',
help=argparse.SUPPRESS) help=argparse.SUPPRESS)
parser.add_argument( parser.add_argument(
'--mac-address', '--mac-address',
help=_('MAC address of this port')) help=_('MAC address of this port.'))
parser.add_argument( parser.add_argument(
'--mac_address', '--mac_address',
help=argparse.SUPPRESS) help=argparse.SUPPRESS)
parser.add_argument( parser.add_argument(
'--device-id', '--device-id',
help=_('Device id of this port')) help=_('Device ID of this port.'))
parser.add_argument( parser.add_argument(
'--device_id', '--device_id',
help=argparse.SUPPRESS) help=argparse.SUPPRESS)
@@ -186,7 +186,7 @@ class CreatePort(neutronV20.CreateCommand, UpdatePortSecGroupMixin,
parser.add_argument( parser.add_argument(
'network_id', metavar='NETWORK', 'network_id', metavar='NETWORK',
help=_('Network id or name this port belongs to')) help=_('Network ID or name this port belongs to.'))
def args2body(self, parsed_args): def args2body(self, parsed_args):
_network_id = neutronV20.find_resourceid_by_name_or_id( _network_id = neutronV20.find_resourceid_by_name_or_id(

View File

@@ -44,7 +44,7 @@ class DeleteQuota(neutronV20.NeutronCommand):
parser = super(DeleteQuota, self).get_parser(prog_name) parser = super(DeleteQuota, self).get_parser(prog_name)
parser.add_argument( parser.add_argument(
'--tenant-id', metavar='tenant-id', '--tenant-id', metavar='tenant-id',
help=_('The owner tenant ID')) help=_('The owner tenant ID.'))
parser.add_argument( parser.add_argument(
'--tenant_id', '--tenant_id',
help=argparse.SUPPRESS) help=argparse.SUPPRESS)
@@ -96,7 +96,7 @@ class ListQuota(neutronV20.NeutronCommand, lister.Lister):
class ShowQuota(neutronV20.NeutronCommand, show.ShowOne): class ShowQuota(neutronV20.NeutronCommand, show.ShowOne):
"""Show quotas of a given tenant """Show quotas of a given tenant.
""" """
api = 'network' api = 'network'
@@ -107,7 +107,7 @@ class ShowQuota(neutronV20.NeutronCommand, show.ShowOne):
parser = super(ShowQuota, self).get_parser(prog_name) parser = super(ShowQuota, self).get_parser(prog_name)
parser.add_argument( parser.add_argument(
'--tenant-id', metavar='tenant-id', '--tenant-id', metavar='tenant-id',
help=_('The owner tenant ID')) help=_('The owner tenant ID.'))
parser.add_argument( parser.add_argument(
'--tenant_id', '--tenant_id',
help=argparse.SUPPRESS) help=argparse.SUPPRESS)
@@ -152,43 +152,43 @@ class UpdateQuota(neutronV20.NeutronCommand, show.ShowOne):
parser = super(UpdateQuota, self).get_parser(prog_name) parser = super(UpdateQuota, self).get_parser(prog_name)
parser.add_argument( parser.add_argument(
'--tenant-id', metavar='tenant-id', '--tenant-id', metavar='tenant-id',
help=_('The owner tenant ID')) help=_('The owner tenant ID.'))
parser.add_argument( parser.add_argument(
'--tenant_id', '--tenant_id',
help=argparse.SUPPRESS) help=argparse.SUPPRESS)
parser.add_argument( parser.add_argument(
'--network', metavar='networks', '--network', metavar='networks',
help=_('The limit of networks')) help=_('The limit of networks.'))
parser.add_argument( parser.add_argument(
'--subnet', metavar='subnets', '--subnet', metavar='subnets',
help=_('The limit of subnets')) help=_('The limit of subnets.'))
parser.add_argument( parser.add_argument(
'--port', metavar='ports', '--port', metavar='ports',
help=_('The limit of ports')) help=_('The limit of ports.'))
parser.add_argument( parser.add_argument(
'--router', metavar='routers', '--router', metavar='routers',
help=_('The limit of routers')) help=_('The limit of routers.'))
parser.add_argument( parser.add_argument(
'--floatingip', metavar='floatingips', '--floatingip', metavar='floatingips',
help=_('The limit of floating IPs')) help=_('The limit of floating IPs.'))
parser.add_argument( parser.add_argument(
'--security-group', metavar='security_groups', '--security-group', metavar='security_groups',
help=_('The limit of security groups')) help=_('The limit of security groups.'))
parser.add_argument( parser.add_argument(
'--security-group-rule', metavar='security_group_rules', '--security-group-rule', metavar='security_group_rules',
help=_('The limit of security groups rules')) help=_('The limit of security groups rules.'))
parser.add_argument( parser.add_argument(
'--vip', metavar='vips', '--vip', metavar='vips',
help=_('the limit of vips')) help=_('The limit of vips.'))
parser.add_argument( parser.add_argument(
'--pool', metavar='pools', '--pool', metavar='pools',
help=_('the limit of pools')) help=_('The limit of pools.'))
parser.add_argument( parser.add_argument(
'--member', metavar='members', '--member', metavar='members',
help=_('the limit of pool members')) help=_('The limit of pool members.'))
parser.add_argument( parser.add_argument(
'--health-monitor', metavar='health_monitors', '--health-monitor', metavar='health_monitors',
help=_('the limit of health monitors')) help=_('The limit of health monitors.'))
return parser return parser

View File

@@ -61,17 +61,17 @@ class CreateRouter(neutronV20.CreateCommand):
parser.add_argument( parser.add_argument(
'--admin-state-down', '--admin-state-down',
dest='admin_state', action='store_false', dest='admin_state', action='store_false',
help=_('Set Admin State Up to false')) help=_('Set admin state up to false.'))
parser.add_argument( parser.add_argument(
'--admin_state_down', '--admin_state_down',
dest='admin_state', action='store_false', dest='admin_state', action='store_false',
help=argparse.SUPPRESS) help=argparse.SUPPRESS)
parser.add_argument( parser.add_argument(
'name', metavar='NAME', 'name', metavar='NAME',
help=_('Name of router to create')) help=_('Name of router to create.'))
parser.add_argument( parser.add_argument(
'distributed', action='store_true', 'distributed', action='store_true',
help=_('Create a distributed router (VMware NSX plugin only)')) help=_('Create a distributed router (VMware NSX plugin only).'))
def args2body(self, parsed_args): def args2body(self, parsed_args):
body = {'router': { body = {'router': {
@@ -112,13 +112,13 @@ class RouterInterfaceCommand(neutronV20.NeutronCommand):
parser = super(RouterInterfaceCommand, self).get_parser(prog_name) parser = super(RouterInterfaceCommand, self).get_parser(prog_name)
parser.add_argument( parser.add_argument(
'router_id', metavar='router-id', 'router_id', metavar='router-id',
help=_('ID of the router')) help=_('ID of the router.'))
parser.add_argument( parser.add_argument(
'interface', metavar='INTERFACE', 'interface', metavar='INTERFACE',
help=_('The format is "SUBNET|subnet=SUBNET|port=PORT". ' help=_('The format is "SUBNET|subnet=SUBNET|port=PORT". '
'Either a subnet or port must be specified. ' 'Either a subnet or port must be specified. '
'Both ID and name are accepted as SUBNET or PORT. ' 'Both ID and name are accepted as SUBNET or PORT. '
'Note that "subnet=" can be omitted when specifying subnet.')) 'Note that "subnet=" can be omitted when specifying a subnet.'))
return parser return parser
def run(self, parsed_args): def run(self, parsed_args):
@@ -184,13 +184,13 @@ class SetGatewayRouter(neutronV20.NeutronCommand):
parser = super(SetGatewayRouter, self).get_parser(prog_name) parser = super(SetGatewayRouter, self).get_parser(prog_name)
parser.add_argument( parser.add_argument(
'router_id', metavar='router-id', 'router_id', metavar='router-id',
help=_('ID of the router')) help=_('ID of the router.'))
parser.add_argument( parser.add_argument(
'external_network_id', metavar='external-network-id', 'external_network_id', metavar='external-network-id',
help=_('ID of the external network for the gateway')) help=_('ID of the external network for the gateway.'))
parser.add_argument( parser.add_argument(
'--disable-snat', action='store_true', '--disable-snat', action='store_true',
help=_('Disable Source NAT on the router gateway')) help=_('Disable source NAT on the router gateway.'))
return parser return parser
def run(self, parsed_args): def run(self, parsed_args):
@@ -220,7 +220,7 @@ class RemoveGatewayRouter(neutronV20.NeutronCommand):
parser = super(RemoveGatewayRouter, self).get_parser(prog_name) parser = super(RemoveGatewayRouter, self).get_parser(prog_name)
parser.add_argument( parser.add_argument(
'router_id', metavar='router-id', 'router_id', metavar='router-id',
help=_('ID of the router')) help=_('ID of the router.'))
return parser return parser
def run(self, parsed_args): def run(self, parsed_args):

View File

@@ -48,10 +48,10 @@ class CreateSecurityGroup(neutronV20.CreateCommand):
def add_known_arguments(self, parser): def add_known_arguments(self, parser):
parser.add_argument( parser.add_argument(
'name', metavar='NAME', 'name', metavar='NAME',
help=_('Name of security group')) help=_('Name of security group.'))
parser.add_argument( parser.add_argument(
'--description', '--description',
help=_('Description of security group')) help=_('Description of security group.'))
def args2body(self, parsed_args): def args2body(self, parsed_args):
body = {'security_group': { body = {'security_group': {
@@ -81,10 +81,10 @@ class UpdateSecurityGroup(neutronV20.UpdateCommand):
def add_known_arguments(self, parser): def add_known_arguments(self, parser):
parser.add_argument( parser.add_argument(
'--name', '--name',
help=_('Name of security group')) help=_('Name of security group.'))
parser.add_argument( parser.add_argument(
'--description', '--description',
help=_('Description of security group')) help=_('Description of security group.'))
def args2body(self, parsed_args): def args2body(self, parsed_args):
body = {'security_group': {}} body = {'security_group': {}}
@@ -113,7 +113,7 @@ class ListSecurityGroupRule(neutronV20.ListCommand):
parser = super(ListSecurityGroupRule, self).get_parser(prog_name) parser = super(ListSecurityGroupRule, self).get_parser(prog_name)
parser.add_argument( parser.add_argument(
'--no-nameconv', action='store_true', '--no-nameconv', action='store_true',
help=_('Do not convert security group ID to its name')) help=_('Do not convert security group ID to its name.'))
return parser return parser
@staticmethod @staticmethod
@@ -183,39 +183,39 @@ class CreateSecurityGroupRule(neutronV20.CreateCommand):
def add_known_arguments(self, parser): def add_known_arguments(self, parser):
parser.add_argument( parser.add_argument(
'security_group_id', metavar='SECURITY_GROUP', 'security_group_id', metavar='SECURITY_GROUP',
help=_('Security group name or id to add rule.')) help=_('Security group name or ID to add rule.'))
parser.add_argument( parser.add_argument(
'--direction', '--direction',
default='ingress', choices=['ingress', 'egress'], default='ingress', choices=['ingress', 'egress'],
help=_('Direction of traffic: ingress/egress')) help=_('Direction of traffic: ingress/egress.'))
parser.add_argument( parser.add_argument(
'--ethertype', '--ethertype',
default='IPv4', default='IPv4',
help=_('IPv4/IPv6')) help=_('IPv4/IPv6'))
parser.add_argument( parser.add_argument(
'--protocol', '--protocol',
help=_('Protocol of packet')) help=_('Protocol of packet.'))
parser.add_argument( parser.add_argument(
'--port-range-min', '--port-range-min',
help=_('Starting port range')) help=_('Starting port range.'))
parser.add_argument( parser.add_argument(
'--port_range_min', '--port_range_min',
help=argparse.SUPPRESS) help=argparse.SUPPRESS)
parser.add_argument( parser.add_argument(
'--port-range-max', '--port-range-max',
help=_('Ending port range')) help=_('Ending port range.'))
parser.add_argument( parser.add_argument(
'--port_range_max', '--port_range_max',
help=argparse.SUPPRESS) help=argparse.SUPPRESS)
parser.add_argument( parser.add_argument(
'--remote-ip-prefix', '--remote-ip-prefix',
help=_('CIDR to match on')) help=_('CIDR to match on.'))
parser.add_argument( parser.add_argument(
'--remote_ip_prefix', '--remote_ip_prefix',
help=argparse.SUPPRESS) help=argparse.SUPPRESS)
parser.add_argument( parser.add_argument(
'--remote-group-id', metavar='REMOTE_GROUP', '--remote-group-id', metavar='REMOTE_GROUP',
help=_('Remote security group name or id to apply rule')) help=_('Remote security group name or ID to apply rule.'))
parser.add_argument( parser.add_argument(
'--remote_group_id', '--remote_group_id',
help=argparse.SUPPRESS) help=argparse.SUPPRESS)

View File

@@ -50,19 +50,19 @@ def _format_host_routes(subnet):
def add_updatable_arguments(parser): def add_updatable_arguments(parser):
parser.add_argument( parser.add_argument(
'--name', '--name',
help=_('Name of this subnet')) help=_('Name of this subnet.'))
parser.add_argument( parser.add_argument(
'--gateway', metavar='GATEWAY_IP', '--gateway', metavar='GATEWAY_IP',
help=_('Gateway ip of this subnet')) help=_('Gateway IP of this subnet.'))
parser.add_argument( parser.add_argument(
'--no-gateway', '--no-gateway',
action='store_true', action='store_true',
help=_('No distribution of gateway')) help=_('No distribution of gateway.'))
parser.add_argument( parser.add_argument(
'--allocation-pool', metavar='start=IP_ADDR,end=IP_ADDR', '--allocation-pool', metavar='start=IP_ADDR,end=IP_ADDR',
action='append', dest='allocation_pools', type=utils.str2dict, action='append', dest='allocation_pools', type=utils.str2dict,
help=_('Allocation pool IP addresses for this subnet ' help=_('Allocation pool IP addresses for this subnet '
'(This option can be repeated)')) '(This option can be repeated).'))
parser.add_argument( parser.add_argument(
'--allocation_pool', '--allocation_pool',
action='append', dest='allocation_pools', type=utils.str2dict, action='append', dest='allocation_pools', type=utils.str2dict,
@@ -70,20 +70,20 @@ def add_updatable_arguments(parser):
parser.add_argument( parser.add_argument(
'--host-route', metavar='destination=CIDR,nexthop=IP_ADDR', '--host-route', metavar='destination=CIDR,nexthop=IP_ADDR',
action='append', dest='host_routes', type=utils.str2dict, action='append', dest='host_routes', type=utils.str2dict,
help=_('Additional route (This option can be repeated)')) help=_('Additional route (This option can be repeated).'))
parser.add_argument( parser.add_argument(
'--dns-nameserver', metavar='DNS_NAMESERVER', '--dns-nameserver', metavar='DNS_NAMESERVER',
action='append', dest='dns_nameservers', action='append', dest='dns_nameservers',
help=_('DNS name server for this subnet ' help=_('DNS name server for this subnet '
'(This option can be repeated)')) '(This option can be repeated).'))
parser.add_argument( parser.add_argument(
'--disable-dhcp', '--disable-dhcp',
action='store_true', action='store_true',
help=_('Disable DHCP for this subnet')) help=_('Disable DHCP for this subnet.'))
parser.add_argument( parser.add_argument(
'--enable-dhcp', '--enable-dhcp',
action='store_true', action='store_true',
help=_('Enable DHCP for this subnet')) help=_('Enable DHCP for this subnet.'))
def updatable_args2body(parsed_args, body): def updatable_args2body(parsed_args, body):
@@ -145,7 +145,7 @@ class CreateSubnet(neutronV20.CreateCommand):
'--ip-version', '--ip-version',
type=int, type=int,
default=4, choices=[4, 6], default=4, choices=[4, 6],
help=_('IP version with default 4')) help=_('IP version to use, default is 4.'))
parser.add_argument( parser.add_argument(
'--ip_version', '--ip_version',
type=int, type=int,
@@ -153,10 +153,10 @@ class CreateSubnet(neutronV20.CreateCommand):
help=argparse.SUPPRESS) help=argparse.SUPPRESS)
parser.add_argument( parser.add_argument(
'network_id', metavar='NETWORK', 'network_id', metavar='NETWORK',
help=_('Network id or name this subnet belongs to')) help=_('Network ID or name this subnet belongs to.'))
parser.add_argument( parser.add_argument(
'cidr', metavar='CIDR', 'cidr', metavar='CIDR',
help=_('CIDR of subnet to create')) help=_('CIDR of subnet to create.'))
def args2body(self, parsed_args): def args2body(self, parsed_args):
_network_id = neutronV20.find_resourceid_by_name_or_id( _network_id = neutronV20.find_resourceid_by_name_or_id(

View File

@@ -25,7 +25,7 @@ from neutronclient.openstack.common.gettextutils import _
class ListIKEPolicy(neutronv20.ListCommand): class ListIKEPolicy(neutronv20.ListCommand):
"""List IKEPolicies that belong to a tenant.""" """List IKE policies that belong to a tenant."""
resource = 'ikepolicy' resource = 'ikepolicy'
log = logging.getLogger(__name__ + '.ListIKEPolicy') log = logging.getLogger(__name__ + '.ListIKEPolicy')
@@ -37,14 +37,14 @@ class ListIKEPolicy(neutronv20.ListCommand):
class ShowIKEPolicy(neutronv20.ShowCommand): class ShowIKEPolicy(neutronv20.ShowCommand):
"""Show information of a given IKEPolicy.""" """Show information of a given IKE policy."""
resource = 'ikepolicy' resource = 'ikepolicy'
log = logging.getLogger(__name__ + '.ShowIKEPolicy') log = logging.getLogger(__name__ + '.ShowIKEPolicy')
class CreateIKEPolicy(neutronv20.CreateCommand): class CreateIKEPolicy(neutronv20.CreateCommand):
"""Create an IKEPolicy.""" """Create an IKE policy."""
resource = 'ikepolicy' resource = 'ikepolicy'
log = logging.getLogger(__name__ + '.CreateIKEPolicy') log = logging.getLogger(__name__ + '.CreateIKEPolicy')
@@ -57,14 +57,14 @@ class CreateIKEPolicy(neutronv20.CreateCommand):
'--auth-algorithm', '--auth-algorithm',
default='sha1', choices=['sha1'], default='sha1', choices=['sha1'],
help=_('Authentication algorithm in lowercase. ' help=_('Authentication algorithm in lowercase. '
'default:sha1')) 'Default:sha1'))
parser.add_argument( parser.add_argument(
'--encryption-algorithm', '--encryption-algorithm',
default='aes-128', choices=['3des', default='aes-128', choices=['3des',
'aes-128', 'aes-128',
'aes-192', 'aes-192',
'aes-256'], 'aes-256'],
help=_('Encryption Algorithm in lowercase, default:aes-128')) help=_('Encryption algorithm in lowercase, default:aes-128'))
parser.add_argument( parser.add_argument(
'--phase1-negotiation-mode', '--phase1-negotiation-mode',
default='main', choices=['main'], default='main', choices=['main'],
@@ -84,7 +84,7 @@ class CreateIKEPolicy(neutronv20.CreateCommand):
help=vpn_utils.lifetime_help("IKE")) help=vpn_utils.lifetime_help("IKE"))
parser.add_argument( parser.add_argument(
'name', metavar='NAME', 'name', metavar='NAME',
help=_('Name of the IKE Policy')) help=_('Name of the IKE policy.'))
def args2body(self, parsed_args): def args2body(self, parsed_args):
@@ -108,7 +108,7 @@ class CreateIKEPolicy(neutronv20.CreateCommand):
class UpdateIKEPolicy(neutronv20.UpdateCommand): class UpdateIKEPolicy(neutronv20.UpdateCommand):
"""Update a given IKE Policy.""" """Update a given IKE policy."""
resource = 'ikepolicy' resource = 'ikepolicy'
log = logging.getLogger(__name__ + '.UpdateIKEPolicy') log = logging.getLogger(__name__ + '.UpdateIKEPolicy')
@@ -131,7 +131,7 @@ class UpdateIKEPolicy(neutronv20.UpdateCommand):
class DeleteIKEPolicy(neutronv20.DeleteCommand): class DeleteIKEPolicy(neutronv20.DeleteCommand):
"""Delete a given IKE Policy.""" """Delete a given IKE policy."""
resource = 'ikepolicy' resource = 'ikepolicy'
log = logging.getLogger(__name__ + '.DeleteIKEPolicy') log = logging.getLogger(__name__ + '.DeleteIKEPolicy')

View File

@@ -54,7 +54,7 @@ class ShowIPsecSiteConnection(neutronv20.ShowCommand):
class CreateIPsecSiteConnection(neutronv20.CreateCommand): class CreateIPsecSiteConnection(neutronv20.CreateCommand):
"""Create an IPsecSiteConnection.""" """Create an IPsec site connection."""
resource = 'ipsec_site_connection' resource = 'ipsec_site_connection'
log = logging.getLogger(__name__ + '.CreateIPsecSiteConnection') log = logging.getLogger(__name__ + '.CreateIPsecSiteConnection')
@@ -62,13 +62,13 @@ class CreateIPsecSiteConnection(neutronv20.CreateCommand):
parser.add_argument( parser.add_argument(
'--admin-state-down', '--admin-state-down',
default=True, action='store_false', default=True, action='store_false',
help=_('Set admin state up to false')) help=_('Set admin state up to false.'))
parser.add_argument( parser.add_argument(
'--name', '--name',
help=_('Set friendly name for the connection')) help=_('Set friendly name for the connection.'))
parser.add_argument( parser.add_argument(
'--description', '--description',
help=_('Set a description for the connection')) help=_('Set a description for the connection.'))
parser.add_argument( parser.add_argument(
'--mtu', '--mtu',
default='1500', default='1500',
@@ -82,19 +82,19 @@ class CreateIPsecSiteConnection(neutronv20.CreateCommand):
'--dpd', '--dpd',
metavar="action=ACTION,interval=INTERVAL,timeout=TIMEOUT", metavar="action=ACTION,interval=INTERVAL,timeout=TIMEOUT",
type=utils.str2dict, type=utils.str2dict,
help=vpn_utils.dpd_help("IPsec Connection")) help=vpn_utils.dpd_help("IPsec connection."))
parser.add_argument( parser.add_argument(
'--vpnservice-id', metavar='VPNSERVICE', '--vpnservice-id', metavar='VPNSERVICE',
required=True, required=True,
help=_('VPNService instance id associated with this connection')) help=_('VPN service instance ID associated with this connection.'))
parser.add_argument( parser.add_argument(
'--ikepolicy-id', metavar='IKEPOLICY', '--ikepolicy-id', metavar='IKEPOLICY',
required=True, required=True,
help=_('IKEPolicy id associated with this connection')) help=_('IKE policy ID associated with this connection.'))
parser.add_argument( parser.add_argument(
'--ipsecpolicy-id', metavar='IPSECPOLICY', '--ipsecpolicy-id', metavar='IPSECPOLICY',
required=True, required=True,
help=_('IPsecPolicy id associated with this connection')) help=_('IPsec policy ID associated with this connection.'))
parser.add_argument( parser.add_argument(
'--peer-address', '--peer-address',
required=True, required=True,
@@ -108,11 +108,11 @@ class CreateIPsecSiteConnection(neutronv20.CreateCommand):
'--peer-cidr', '--peer-cidr',
action='append', dest='peer_cidrs', action='append', dest='peer_cidrs',
required=True, required=True,
help=_('Remote subnet(s) in CIDR format')) help=_('Remote subnet(s) in CIDR format.'))
parser.add_argument( parser.add_argument(
'--psk', '--psk',
required=True, required=True,
help=_('Pre-Shared Key string')) help=_('Pre-shared key string.'))
def args2body(self, parsed_args): def args2body(self, parsed_args):
_vpnservice_id = neutronv20.find_resourceid_by_name_or_id( _vpnservice_id = neutronv20.find_resourceid_by_name_or_id(
@@ -173,7 +173,7 @@ class UpdateIPsecSiteConnection(neutronv20.UpdateCommand):
'--dpd', '--dpd',
metavar="action=ACTION,interval=INTERVAL,timeout=TIMEOUT", metavar="action=ACTION,interval=INTERVAL,timeout=TIMEOUT",
type=utils.str2dict, type=utils.str2dict,
help=vpn_utils.dpd_help("IPsec Connection")) help=vpn_utils.dpd_help("IPsec connection"))
def args2body(self, parsed_args): def args2body(self, parsed_args):
body = {'ipsec_site_connection': { body = {'ipsec_site_connection': {

View File

@@ -36,14 +36,14 @@ class ListIPsecPolicy(neutronv20.ListCommand):
class ShowIPsecPolicy(neutronv20.ShowCommand): class ShowIPsecPolicy(neutronv20.ShowCommand):
"""Show information of a given ipsecpolicy.""" """Show information of a given IPsec policy."""
resource = 'ipsecpolicy' resource = 'ipsecpolicy'
log = logging.getLogger(__name__ + '.ShowIPsecPolicy') log = logging.getLogger(__name__ + '.ShowIPsecPolicy')
class CreateIPsecPolicy(neutronv20.CreateCommand): class CreateIPsecPolicy(neutronv20.CreateCommand):
"""Create an ipsecpolicy.""" """Create an IPsec policy."""
resource = 'ipsecpolicy' resource = 'ipsecpolicy'
log = logging.getLogger(__name__ + '.CreateIPsecPolicy') log = logging.getLogger(__name__ + '.CreateIPsecPolicy')
@@ -51,11 +51,11 @@ class CreateIPsecPolicy(neutronv20.CreateCommand):
def add_known_arguments(self, parser): def add_known_arguments(self, parser):
parser.add_argument( parser.add_argument(
'--description', '--description',
help=_('Description of the IPsecPolicy')) help=_('Description of the IPsec policy.'))
parser.add_argument( parser.add_argument(
'--transform-protocol', '--transform-protocol',
default='esp', choices=['esp', 'ah', 'ah-esp'], default='esp', choices=['esp', 'ah', 'ah-esp'],
help=_('Transform Protocol in lowercase, default:esp')) help=_('Transform protocol in lowercase, default:esp'))
parser.add_argument( parser.add_argument(
'--auth-algorithm', '--auth-algorithm',
default='sha1', choices=['sha1'], default='sha1', choices=['sha1'],
@@ -66,11 +66,11 @@ class CreateIPsecPolicy(neutronv20.CreateCommand):
'aes-128', 'aes-128',
'aes-192', 'aes-192',
'aes-256'], 'aes-256'],
help=_('Encryption Algorithm in lowercase, default:aes-128')) help=_('Encryption algorithm in lowercase, default:aes-128'))
parser.add_argument( parser.add_argument(
'--encapsulation-mode', '--encapsulation-mode',
default='tunnel', choices=['tunnel', 'transport'], default='tunnel', choices=['tunnel', 'transport'],
help=_('Encapsulation Mode in lowercase, default:tunnel')) help=_('Encapsulation mode in lowercase, default:tunnel'))
parser.add_argument( parser.add_argument(
'--pfs', '--pfs',
default='group5', choices=['group2', 'group5', 'group14'], default='group5', choices=['group2', 'group5', 'group14'],
@@ -82,7 +82,7 @@ class CreateIPsecPolicy(neutronv20.CreateCommand):
help=vpn_utils.lifetime_help("IPsec")) help=vpn_utils.lifetime_help("IPsec"))
parser.add_argument( parser.add_argument(
'name', metavar='NAME', 'name', metavar='NAME',
help=_('Name of the IPsecPolicy')) help=_('Name of the IPsec policy.'))
def args2body(self, parsed_args): def args2body(self, parsed_args):
@@ -108,7 +108,7 @@ class CreateIPsecPolicy(neutronv20.CreateCommand):
class UpdateIPsecPolicy(neutronv20.UpdateCommand): class UpdateIPsecPolicy(neutronv20.UpdateCommand):
"""Update a given ipsec policy.""" """Update a given IPsec policy."""
resource = 'ipsecpolicy' resource = 'ipsecpolicy'
log = logging.getLogger(__name__ + '.UpdateIPsecPolicy') log = logging.getLogger(__name__ + '.UpdateIPsecPolicy')
@@ -131,7 +131,7 @@ class UpdateIPsecPolicy(neutronv20.UpdateCommand):
class DeleteIPsecPolicy(neutronv20.DeleteCommand): class DeleteIPsecPolicy(neutronv20.DeleteCommand):
"""Delete a given ipsecpolicy.""" """Delete a given IPsec policy."""
resource = 'ipsecpolicy' resource = 'ipsecpolicy'
log = logging.getLogger(__name__ + '.DeleteIPsecPolicy') log = logging.getLogger(__name__ + '.DeleteIPsecPolicy')

View File

@@ -98,14 +98,14 @@ def validate_lifetime_dict(lifetime_dict):
def lifetime_help(policy): def lifetime_help(policy):
lifetime = _("%s Lifetime Attributes." lifetime = _("%s lifetime attributes. "
"'units'-seconds, default:seconds. " "'units'-seconds, default:seconds. "
"'value'-non negative integer, default:3600.") % policy "'value'-non negative integer, default:3600.") % policy
return lifetime return lifetime
def dpd_help(policy): def dpd_help(policy):
dpd = _(" %s Dead Peer Detection Attributes. " dpd = _(" %s Dead Peer Detection attributes."
" 'action'-hold,clear,disabled,restart,restart-by-peer." " 'action'-hold,clear,disabled,restart,restart-by-peer."
" 'interval' and 'timeout' are non negative integers. " " 'interval' and 'timeout' are non negative integers. "
" 'interval' should be less than 'timeout' value. " " 'interval' should be less than 'timeout' value. "

View File

@@ -23,7 +23,7 @@ from neutronclient.openstack.common.gettextutils import _
class ListVPNService(neutronv20.ListCommand): class ListVPNService(neutronv20.ListCommand):
"""List VPNService configurations that belong to a given tenant.""" """List VPN service configurations that belong to a given tenant."""
resource = 'vpnservice' resource = 'vpnservice'
log = logging.getLogger(__name__ + '.ListVPNService') log = logging.getLogger(__name__ + '.ListVPNService')
@@ -36,14 +36,14 @@ class ListVPNService(neutronv20.ListCommand):
class ShowVPNService(neutronv20.ShowCommand): class ShowVPNService(neutronv20.ShowCommand):
"""Show information of a given VPNService.""" """Show information of a given VPN service."""
resource = 'vpnservice' resource = 'vpnservice'
log = logging.getLogger(__name__ + '.ShowVPNService') log = logging.getLogger(__name__ + '.ShowVPNService')
class CreateVPNService(neutronv20.CreateCommand): class CreateVPNService(neutronv20.CreateCommand):
"""Create a VPNService.""" """Create a VPN service."""
resource = 'vpnservice' resource = 'vpnservice'
log = logging.getLogger(__name__ + '.CreateVPNService') log = logging.getLogger(__name__ + '.CreateVPNService')
@@ -51,19 +51,19 @@ class CreateVPNService(neutronv20.CreateCommand):
parser.add_argument( parser.add_argument(
'--admin-state-down', '--admin-state-down',
dest='admin_state', action='store_false', dest='admin_state', action='store_false',
help=_('Set admin state up to false')) help=_('Set admin state up to false.'))
parser.add_argument( parser.add_argument(
'--name', '--name',
help=_('Set a name for the vpnservice')) help=_('Set a name for the VPN service.'))
parser.add_argument( parser.add_argument(
'--description', '--description',
help=_('Set a description for the vpnservice')) help=_('Set a description for the VPN service.'))
parser.add_argument( parser.add_argument(
'router', metavar='ROUTER', 'router', metavar='ROUTER',
help=_('Router unique identifier for the vpnservice')) help=_('Router unique identifier for the VPN service.'))
parser.add_argument( parser.add_argument(
'subnet', metavar='SUBNET', 'subnet', metavar='SUBNET',
help=_('Subnet unique identifier for the vpnservice deployment')) help=_('Subnet unique identifier for the VPN service deployment.'))
def args2body(self, parsed_args): def args2body(self, parsed_args):
_subnet_id = neutronv20.find_resourceid_by_name_or_id( _subnet_id = neutronv20.find_resourceid_by_name_or_id(
@@ -84,14 +84,14 @@ class CreateVPNService(neutronv20.CreateCommand):
class UpdateVPNService(neutronv20.UpdateCommand): class UpdateVPNService(neutronv20.UpdateCommand):
"""Update a given VPNService.""" """Update a given VPN service."""
resource = 'vpnservice' resource = 'vpnservice'
log = logging.getLogger(__name__ + '.UpdateVPNService') log = logging.getLogger(__name__ + '.UpdateVPNService')
class DeleteVPNService(neutronv20.DeleteCommand): class DeleteVPNService(neutronv20.DeleteCommand):
"""Delete a given VPNService.""" """Delete a given VPN service."""
resource = 'vpnservice' resource = 'vpnservice'
log = logging.getLogger(__name__ + '.DeleteVPNService') log = logging.getLogger(__name__ + '.DeleteVPNService')

View File

@@ -361,20 +361,20 @@ class NeutronShell(app.App):
action='store_const', action='store_const',
dest='verbose_level', dest='verbose_level',
const=0, const=0,
help=_('Suppress output except warnings and errors')) help=_('Suppress output except warnings and errors.'))
parser.add_argument( parser.add_argument(
'-h', '--help', '-h', '--help',
action=HelpAction, action=HelpAction,
nargs=0, nargs=0,
default=self, # tricky default=self, # tricky
help=_("Show this help message and exit")) help=_("Show this help message and exit."))
# Global arguments # Global arguments
parser.add_argument( parser.add_argument(
'--os-auth-strategy', metavar='<auth-strategy>', '--os-auth-strategy', metavar='<auth-strategy>',
default=env('OS_AUTH_STRATEGY', default='keystone'), default=env('OS_AUTH_STRATEGY', default='keystone'),
help=_('Authentication strategy (Env: OS_AUTH_STRATEGY' help=_('Authentication strategy, defaults to '
', default keystone). For now, any other value will' 'env[OS_AUTH_STRATEGY] or keystone. For now, any '
' disable the authentication')) 'other value will disable the authentication.'))
parser.add_argument( parser.add_argument(
'--os_auth_strategy', '--os_auth_strategy',
help=argparse.SUPPRESS) help=argparse.SUPPRESS)
@@ -382,7 +382,7 @@ class NeutronShell(app.App):
parser.add_argument( parser.add_argument(
'--os-auth-url', metavar='<auth-url>', '--os-auth-url', metavar='<auth-url>',
default=env('OS_AUTH_URL'), default=env('OS_AUTH_URL'),
help=_('Authentication URL (Env: OS_AUTH_URL)')) help=_('Authentication URL, defaults to env[OS_AUTH_URL].'))
parser.add_argument( parser.add_argument(
'--os_auth_url', '--os_auth_url',
help=argparse.SUPPRESS) help=argparse.SUPPRESS)
@@ -390,7 +390,8 @@ class NeutronShell(app.App):
parser.add_argument( parser.add_argument(
'--os-tenant-name', metavar='<auth-tenant-name>', '--os-tenant-name', metavar='<auth-tenant-name>',
default=env('OS_TENANT_NAME'), default=env('OS_TENANT_NAME'),
help=_('Authentication tenant name (Env: OS_TENANT_NAME)')) help=_('Authentication tenant name, defaults to '
'env[OS_TENANT_NAME].'))
parser.add_argument( parser.add_argument(
'--os_tenant_name', '--os_tenant_name',
help=argparse.SUPPRESS) help=argparse.SUPPRESS)
@@ -398,12 +399,13 @@ class NeutronShell(app.App):
parser.add_argument( parser.add_argument(
'--os-tenant-id', metavar='<auth-tenant-id>', '--os-tenant-id', metavar='<auth-tenant-id>',
default=env('OS_TENANT_ID'), default=env('OS_TENANT_ID'),
help=_('Authentication tenant ID (Env: OS_TENANT_ID)')) help=_('Authentication tenant ID, defaults to '
'env[OS_TENANT_ID].'))
parser.add_argument( parser.add_argument(
'--os-username', metavar='<auth-username>', '--os-username', metavar='<auth-username>',
default=utils.env('OS_USERNAME'), default=utils.env('OS_USERNAME'),
help=_('Authentication username (Env: OS_USERNAME)')) help=_('Authentication username, defaults to env[OS_USERNAME].'))
parser.add_argument( parser.add_argument(
'--os_username', '--os_username',
help=argparse.SUPPRESS) help=argparse.SUPPRESS)
@@ -416,7 +418,7 @@ class NeutronShell(app.App):
parser.add_argument( parser.add_argument(
'--os-password', metavar='<auth-password>', '--os-password', metavar='<auth-password>',
default=utils.env('OS_PASSWORD'), default=utils.env('OS_PASSWORD'),
help=_('Authentication password (Env: OS_PASSWORD)')) help=_('Authentication password, defaults to env[OS_PASSWORD].'))
parser.add_argument( parser.add_argument(
'--os_password', '--os_password',
help=argparse.SUPPRESS) help=argparse.SUPPRESS)
@@ -424,7 +426,8 @@ class NeutronShell(app.App):
parser.add_argument( parser.add_argument(
'--os-region-name', metavar='<auth-region-name>', '--os-region-name', metavar='<auth-region-name>',
default=env('OS_REGION_NAME'), default=env('OS_REGION_NAME'),
help=_('Authentication region name (Env: OS_REGION_NAME)')) help=_('Authentication region name, defaults to '
'env[OS_REGION_NAME].'))
parser.add_argument( parser.add_argument(
'--os_region_name', '--os_region_name',
help=argparse.SUPPRESS) help=argparse.SUPPRESS)
@@ -432,7 +435,7 @@ class NeutronShell(app.App):
parser.add_argument( parser.add_argument(
'--os-token', metavar='<token>', '--os-token', metavar='<token>',
default=env('OS_TOKEN'), default=env('OS_TOKEN'),
help=_('Defaults to env[OS_TOKEN]')) help=_('Authentication token, defaults to env[OS_TOKEN].'))
parser.add_argument( parser.add_argument(
'--os_token', '--os_token',
help=argparse.SUPPRESS) help=argparse.SUPPRESS)
@@ -450,7 +453,7 @@ class NeutronShell(app.App):
parser.add_argument( parser.add_argument(
'--os-url', metavar='<url>', '--os-url', metavar='<url>',
default=env('OS_URL'), default=env('OS_URL'),
help=_('Defaults to env[OS_URL]')) help=_('Defaults to env[OS_URL].'))
parser.add_argument( parser.add_argument(
'--os_url', '--os_url',
help=argparse.SUPPRESS) help=argparse.SUPPRESS)
@@ -461,7 +464,7 @@ class NeutronShell(app.App):
default=env('OS_CACERT', default=None), default=env('OS_CACERT', default=None),
help=_("Specify a CA bundle file to use in " help=_("Specify a CA bundle file to use in "
"verifying a TLS (https) server certificate. " "verifying a TLS (https) server certificate. "
"Defaults to env[OS_CACERT]")) "Defaults to env[OS_CACERT]."))
parser.add_argument( parser.add_argument(
'--insecure', '--insecure',

View File

@@ -512,28 +512,28 @@ class Client(object):
@APIParamsCall @APIParamsCall
def list_vpnservices(self, retrieve_all=True, **_params): def list_vpnservices(self, retrieve_all=True, **_params):
"""Fetches a list of all configured VPNServices for a tenant.""" """Fetches a list of all configured VPN services for a tenant."""
return self.list('vpnservices', self.vpnservices_path, retrieve_all, return self.list('vpnservices', self.vpnservices_path, retrieve_all,
**_params) **_params)
@APIParamsCall @APIParamsCall
def show_vpnservice(self, vpnservice, **_params): def show_vpnservice(self, vpnservice, **_params):
"""Fetches information of a specific VPNService.""" """Fetches information of a specific VPN service."""
return self.get(self.vpnservice_path % (vpnservice), params=_params) return self.get(self.vpnservice_path % (vpnservice), params=_params)
@APIParamsCall @APIParamsCall
def create_vpnservice(self, body=None): def create_vpnservice(self, body=None):
"""Creates a new VPNService.""" """Creates a new VPN service."""
return self.post(self.vpnservices_path, body=body) return self.post(self.vpnservices_path, body=body)
@APIParamsCall @APIParamsCall
def update_vpnservice(self, vpnservice, body=None): def update_vpnservice(self, vpnservice, body=None):
"""Updates a VPNService.""" """Updates a VPN service."""
return self.put(self.vpnservice_path % (vpnservice), body=body) return self.put(self.vpnservice_path % (vpnservice), body=body)
@APIParamsCall @APIParamsCall
def delete_vpnservice(self, vpnservice): def delete_vpnservice(self, vpnservice):
"""Deletes the specified VPNService.""" """Deletes the specified VPN service."""
return self.delete(self.vpnservice_path % (vpnservice)) return self.delete(self.vpnservice_path % (vpnservice))
@APIParamsCall @APIParamsCall