Merge "Remove inconsistency from vpn help text"

This commit is contained in:
Jenkins
2016-01-22 20:56:08 +00:00
committed by Gerrit Code Review
5 changed files with 24 additions and 3 deletions

View File

@@ -494,6 +494,7 @@ class UpdateCommand(NeutronCommand):
log = None
allow_names = True
help_resource = None
def get_parser(self, prog_name):
parser = super(UpdateCommand, self).get_parser(prog_name)
@@ -501,9 +502,11 @@ class UpdateCommand(NeutronCommand):
help_str = _('ID or name of %s to update.')
else:
help_str = _('ID of %s to update.')
if not self.help_resource:
self.help_resource = self.resource
parser.add_argument(
'id', metavar=self.resource.upper(),
help=help_str % self.resource)
help=help_str % self.help_resource)
self.add_known_arguments(parser)
return parser
@@ -548,6 +551,7 @@ class DeleteCommand(NeutronCommand):
log = None
allow_names = True
help_resource = None
def get_parser(self, prog_name):
parser = super(DeleteCommand, self).get_parser(prog_name)
@@ -555,9 +559,11 @@ class DeleteCommand(NeutronCommand):
help_str = _('ID or name of %s to delete.')
else:
help_str = _('ID of %s to delete.')
if not self.help_resource:
self.help_resource = self.resource
parser.add_argument(
'id', metavar=self.resource.upper(),
help=help_str % self.resource)
help=help_str % self.help_resource)
self.add_known_arguments(parser)
return parser
@@ -698,6 +704,7 @@ class ShowCommand(NeutronCommand, show.ShowOne):
log = None
allow_names = True
help_resource = None
def get_parser(self, prog_name):
parser = super(ShowCommand, self).get_parser(prog_name)
@@ -706,9 +713,11 @@ class ShowCommand(NeutronCommand, show.ShowOne):
help_str = _('ID or name of %s to look up.')
else:
help_str = _('ID of %s to look up.')
if not self.help_resource:
self.help_resource = self.resource
parser.add_argument(
'id', metavar=self.resource.upper(),
help=help_str % self.resource)
help=help_str % self.help_resource)
self.add_known_arguments(parser)
return parser

View File

@@ -35,6 +35,7 @@ class ShowIKEPolicy(neutronv20.ShowCommand):
"""Show information of a given IKE policy."""
resource = 'ikepolicy'
help_resource = 'IKE policy'
class CreateIKEPolicy(neutronv20.CreateCommand):
@@ -93,6 +94,7 @@ class UpdateIKEPolicy(neutronv20.UpdateCommand):
"""Update a given IKE policy."""
resource = 'ikepolicy'
help_resource = 'IKE policy'
def add_known_arguments(self, parser):
parser.add_argument(
@@ -114,3 +116,4 @@ class DeleteIKEPolicy(neutronv20.DeleteCommand):
"""Delete a given IKE policy."""
resource = 'ikepolicy'
help_resource = 'IKE policy'

View File

@@ -46,6 +46,7 @@ class ShowIPsecSiteConnection(neutronv20.ShowCommand):
"""Show information of a given IPsec site connection."""
resource = 'ipsec_site_connection'
help_resource = 'IPsec site connection'
class IPsecSiteConnectionMixin(object):
@@ -196,9 +197,11 @@ class UpdateIPsecSiteConnection(IPsecSiteConnectionMixin,
"""Update a given IPsec site connection."""
resource = 'ipsec_site_connection'
help_resource = 'IPsec site connection'
class DeleteIPsecSiteConnection(neutronv20.DeleteCommand):
"""Delete a given IPsec site connection."""
resource = 'ipsec_site_connection'
help_resource = 'IPsec site connection'

View File

@@ -35,6 +35,7 @@ class ShowIPsecPolicy(neutronv20.ShowCommand):
"""Show information of a given IPsec policy."""
resource = 'ipsecpolicy'
help_resource = 'IPsec policy'
class CreateIPsecPolicy(neutronv20.CreateCommand):
@@ -92,6 +93,7 @@ class UpdateIPsecPolicy(neutronv20.UpdateCommand):
"""Update a given IPsec policy."""
resource = 'ipsecpolicy'
help_resource = 'IPsec policy'
def add_known_arguments(self, parser):
parser.add_argument(
@@ -113,3 +115,4 @@ class DeleteIPsecPolicy(neutronv20.DeleteCommand):
"""Delete a given IPsec policy."""
resource = 'ipsecpolicy'
help_resource = 'IPsec policy'

View File

@@ -34,6 +34,7 @@ class ShowVPNService(neutronv20.ShowCommand):
"""Show information of a given VPN service."""
resource = 'vpnservice'
help_resource = 'VPN service'
class CreateVPNService(neutronv20.CreateCommand):
@@ -83,9 +84,11 @@ class UpdateVPNService(neutronv20.UpdateCommand):
"""Update a given VPN service."""
resource = 'vpnservice'
help_resource = 'VPN service'
class DeleteVPNService(neutronv20.DeleteCommand):
"""Delete a given VPN service."""
resource = 'vpnservice'
help_resource = 'VPN service'