Remove inconsistency from vpn help text

Improve help text for IKEPOLICY VPNSERVICE IPSECPOLICY
IPSECSITECONNECTION
in python-neutronclient
Fixes bug #1335160

Change-Id: I5da7efe8f8c8e6494884571b3d70237782cd314f
Closes-bug: #1335160
This commit is contained in:
linwwu
2016-01-13 08:22:05 +08:00
parent f8c1f4ec8d
commit c2545f869a
5 changed files with 24 additions and 3 deletions

View File

@@ -513,6 +513,7 @@ class UpdateCommand(NeutronCommand):
api = 'network'
log = None
allow_names = True
help_resource = None
def get_parser(self, prog_name):
parser = super(UpdateCommand, self).get_parser(prog_name)
@@ -520,9 +521,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
@@ -568,6 +571,7 @@ class DeleteCommand(NeutronCommand):
api = 'network'
log = None
allow_names = True
help_resource = None
def get_parser(self, prog_name):
parser = super(DeleteCommand, self).get_parser(prog_name)
@@ -575,9 +579,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
@@ -720,6 +726,7 @@ class ShowCommand(NeutronCommand, show.ShowOne):
api = 'network'
log = None
allow_names = True
help_resource = None
def get_parser(self, prog_name):
parser = super(ShowCommand, self).get_parser(prog_name)
@@ -728,9 +735,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'