Use 'IPsec' consistently

Previously both 'IPsec' and 'IPSec' are used. It is consistent.
In IETF we use 'IPsec' consistently and 'IPsec' looks a better choice.

This commit also updates unnecessary capitalizations like:
- IPsec Policy -> IPsec policy
- IKE Policy -> IKE policy
- IPsec Site Connection -> IPsec site connection
- VPN Service -> VPN service

In the horizon convention, every word is capitalized
only in page titles, action captions and field captions.
For other messages, there is no need to capitalize them.

Change-Id: I7f3ba10d5a7051fe598b45d13af79cc1ead0285f
Closes-Bug: #1713766
This commit is contained in:
Akihiro Motoki 2017-08-29 17:16:09 +00:00 committed by Cao Xuan Hoang
parent e448fadffc
commit e3156ce5f9
20 changed files with 260 additions and 255 deletions

View File

@ -25,19 +25,19 @@ neutronclient = neutron.neutronclient
class IKEPolicy(neutron.NeutronAPIDictWrapper):
"""Wrapper for neutron VPN IKEPolicy."""
"""Wrapper for neutron VPN IKE policy."""
class IPSecPolicy(neutron.NeutronAPIDictWrapper):
"""Wrapper for neutron VPN IPSecPolicy."""
class IPsecPolicy(neutron.NeutronAPIDictWrapper):
"""Wrapper for neutron VPN IPsec policy."""
class IPSecSiteConnection(neutron.NeutronAPIDictWrapper):
"""Wrapper for neutron IPSecSiteConnection."""
class IPsecSiteConnection(neutron.NeutronAPIDictWrapper):
"""Wrapper for neutron IPsec site connection."""
class VPNService(neutron.NeutronAPIDictWrapper):
"""Wrapper for neutron VPNService."""
"""Wrapper for neutron VPN service."""
class EndpointGroup(neutron.NeutronAPIDictWrapper):
@ -46,14 +46,14 @@ class EndpointGroup(neutron.NeutronAPIDictWrapper):
@profiler.trace
def vpnservice_create(request, **kwargs):
"""Create VPNService
"""Create VPN service
:param request: request context
:param admin_state_up: admin state (default on)
:param name: name for VPNService
:param description: description for VPNService
:param router_id: router id for router of VPNService
:param subnet_id: subnet id for subnet of VPNService
:param name: name for VPN service
:param description: description for VPN service
:param router_id: router id for router of VPN service
:param subnet_id: subnet id for subnet of VPN service
"""
body = {'vpnservice':
{'admin_state_up': kwargs['admin_state_up'],
@ -205,17 +205,17 @@ def endpointgroup_delete(request, endpoint_group_id):
@profiler.trace
def ikepolicy_create(request, **kwargs):
"""Create IKEPolicy
"""Create IKE policy
:param request: request context
:param name: name for IKEPolicy
:param description: description for IKEPolicy
:param auth_algorithm: authorization algorithm for IKEPolicy
:param encryption_algorithm: encryption algorithm for IKEPolicy
:param ike_version: IKE version for IKEPolicy
:param lifetime: Lifetime Units and Value for IKEPolicy
:param pfs: Perfect Forward Secrecy for IKEPolicy
:param phase1_negotiation_mode: IKE Phase1 negotiation mode for IKEPolicy
:param name: name for IKE policy
:param description: description for IKE policy
:param auth_algorithm: authorization algorithm for IKE policy
:param encryption_algorithm: encryption algorithm for IKE policy
:param ike_version: IKE version for IKE policy
:param lifetime: Lifetime Units and Value for IKE policy
:param pfs: Perfect Forward Secrecy for IKE policy
:param phase1_negotiation_mode: IKE Phase1 negotiation mode for IKE policy
"""
body = {'ikepolicy':
{'name': kwargs['name'],
@ -277,17 +277,17 @@ def ikepolicy_delete(request, ikepolicy_id):
@profiler.trace
def ipsecpolicy_create(request, **kwargs):
"""Create IPSecPolicy
"""Create IPsec policy
:param request: request context
:param name: name for IPSecPolicy
:param description: description for IPSecPolicy
:param auth_algorithm: authorization algorithm for IPSecPolicy
:param encapsulation_mode: encapsulation mode for IPSecPolicy
:param encryption_algorithm: encryption algorithm for IPSecPolicy
:param lifetime: Lifetime Units and Value for IPSecPolicy
:param pfs: Perfect Forward Secrecy for IPSecPolicy
:param transform_protocol: Transform Protocol for IPSecPolicy
:param name: name for IPsec policy
:param description: description for IPsec policy
:param auth_algorithm: authorization algorithm for IPsec policy
:param encapsulation_mode: encapsulation mode for IPsec policy
:param encryption_algorithm: encryption algorithm for IPsec policy
:param lifetime: Lifetime Units and Value for IPsec policy
:param pfs: Perfect Forward Secrecy for IPsec policy
:param transform_protocol: Transform Protocol for IPsec policy
"""
body = {'ipsecpolicy':
{'name': kwargs['name'],
@ -301,7 +301,7 @@ def ipsecpolicy_create(request, **kwargs):
}
ipsecpolicy = neutronclient(request).create_ipsecpolicy(body).get(
'ipsecpolicy')
return IPSecPolicy(ipsecpolicy)
return IPsecPolicy(ipsecpolicy)
@profiler.trace
@ -317,7 +317,7 @@ def _ipsecpolicy_list(request, expand_conns=False, **kwargs):
for p in ipsecpolicies:
p['ipsecsiteconns'] = [c.id for c in ipsecsiteconns
if c.ipsecpolicy_id == p['id']]
return [IPSecPolicy(v) for v in ipsecpolicies]
return [IPsecPolicy(v) for v in ipsecpolicies]
@profiler.trace
@ -333,14 +333,14 @@ def _ipsecpolicy_get(request, ipsecpolicy_id, expand_conns=False):
ipsecpolicy['ipsecsiteconns'] = [c for c in ipsecsiteconns
if (c.ipsecpolicy_id ==
ipsecpolicy['id'])]
return IPSecPolicy(ipsecpolicy)
return IPsecPolicy(ipsecpolicy)
@profiler.trace
def ipsecpolicy_update(request, ipsecpolicy_id, **kwargs):
ipsecpolicy = neutronclient(request).update_ipsecpolicy(
ipsecpolicy_id, kwargs).get('ipsecpolicy')
return IPSecPolicy(ipsecpolicy)
return IPsecPolicy(ipsecpolicy)
@profiler.trace
@ -350,13 +350,13 @@ def ipsecpolicy_delete(request, ipsecpolicy_id):
@profiler.trace
def ipsecsiteconnection_create(request, **kwargs):
"""Create IPSecSiteConnection
"""Create IPsec site connection
:param request: request context
:param name: name for IPSecSiteConnection
:param description: description for IPSecSiteConnection
:param name: name for IPsec site connection
:param description: description for IPsec site connection
:param dpd: dead peer detection action, interval and timeout
:param ikepolicy_id: IKEPolicy associated with this connection
:param ikepolicy_id: IKE policy associated with this connection
:param initiator: initiator state
:param ipsecpolicy_id: IPsecPolicy associated with this connection
:param mtu: MTU size for the connection
@ -364,7 +364,7 @@ def ipsecsiteconnection_create(request, **kwargs):
:param peer_cidrs: remote subnet(s) in CIDR format
:param peer_id: Peer router identity for authentication"
:param psk: Pre-Shared Key string
:param vpnservice_id: VPNService associated with this connection
:param vpnservice_id: VPN service associated with this connection
:param admin_state_up: admin state (default on)
"""
body = {
@ -389,7 +389,7 @@ def ipsecsiteconnection_create(request, **kwargs):
body['peer_cidrs'] = kwargs['peer_cidrs']
ipsecsiteconnection = neutronclient(request).create_ipsec_site_connection(
{'ipsec_site_connection': body}).get('ipsec_site_connection')
return IPSecSiteConnection(ipsecsiteconnection)
return IPsecSiteConnection(ipsecsiteconnection)
@profiler.trace
@ -423,7 +423,7 @@ def _ipsecsiteconnection_list(request, expand_ikepolicies=False,
for c in ipsecsiteconnections:
c['vpnservice_name'] = service_dict.get(c['vpnservice_id']
).name_or_id
return [IPSecSiteConnection(v) for v in ipsecsiteconnections]
return [IPsecSiteConnection(v) for v in ipsecsiteconnections]
@profiler.trace
@ -448,14 +448,14 @@ def _ipsecsiteconnection_get(request, ipsecsiteconnection_id,
if expand_vpnservices:
ipsecsiteconnection['vpnservice'] = _vpnservice_get(
request, ipsecsiteconnection['vpnservice_id'])
return IPSecSiteConnection(ipsecsiteconnection)
return IPsecSiteConnection(ipsecsiteconnection)
@profiler.trace
def ipsecsiteconnection_update(request, ipsecsiteconnection_id, **kwargs):
ipsecsiteconnection = neutronclient(request).update_ipsec_site_connection(
ipsecsiteconnection_id, kwargs).get('ipsec_site_connection')
return IPSecSiteConnection(ipsecsiteconnection)
return IPsecSiteConnection(ipsecsiteconnection)
@profiler.trace

View File

@ -47,14 +47,14 @@ class UpdateVPNService(forms.SelfHandlingForm):
}}
vpnservice = api_vpn.vpnservice_update(
request, context['vpnservice_id'], **data)
msg = (_('VPN Service %s was successfully updated.')
msg = (_('VPN service %s was successfully updated.')
% context['name'])
messages.success(request, msg)
return vpnservice
except Exception as e:
LOG.info('Failed to update VPN Service %(id)s: %(exc)s',
LOG.info('Failed to update VPN service %(id)s: %(exc)s',
{'id': context['vpnservice_id'], 'exc': e})
msg = _('Failed to update VPN Service %s') % context['name']
msg = _('Failed to update VPN service %s') % context['name']
redirect = reverse(self.failure_url)
exceptions.handle(request, msg, redirect=redirect)
@ -161,19 +161,19 @@ class UpdateIKEPolicy(forms.SelfHandlingForm):
}}
ikepolicy = api_vpn.ikepolicy_update(
request, context['ikepolicy_id'], **data)
msg = (_('IKE Policy %s was successfully updated.')
msg = (_('IKE policy %s was successfully updated.')
% context['name'])
messages.success(request, msg)
return ikepolicy
except Exception as e:
LOG.info('Failed to update IKE Policy %(id)s: %(exc)s',
LOG.info('Failed to update IKE policy %(id)s: %(exc)s',
{'id': context['ikepolicy_id'], 'exc': e})
msg = _('Failed to update IKE Policy %s') % context['name']
msg = _('Failed to update IKE policy %s') % context['name']
redirect = reverse(self.failure_url)
exceptions.handle(request, msg, redirect=redirect)
class UpdateIPSecPolicy(forms.SelfHandlingForm):
class UpdateIPsecPolicy(forms.SelfHandlingForm):
name = forms.CharField(max_length=80, label=_("Name"), required=False)
ipsecpolicy_id = forms.CharField(
label=_("ID"),
@ -239,19 +239,19 @@ class UpdateIPSecPolicy(forms.SelfHandlingForm):
}}
ipsecpolicy = api_vpn.ipsecpolicy_update(
request, context['ipsecpolicy_id'], **data)
msg = (_('IPSec Policy %s was successfully updated.')
msg = (_('IPsec policy %s was successfully updated.')
% context['name'])
messages.success(request, msg)
return ipsecpolicy
except Exception as e:
LOG.info('Failed to update IPSec Policy %(id)s: %(exc)s',
LOG.info('Failed to update IPsec policy %(id)s: %(exc)s',
{'id': context['ipsecpolicy_id'], 'exc': e})
msg = _('Failed to update IPSec Policy %s') % context['name']
msg = _('Failed to update IPsec policy %s') % context['name']
redirect = reverse(self.failure_url)
exceptions.handle(request, msg, redirect=redirect)
class UpdateIPSecSiteConnection(forms.SelfHandlingForm):
class UpdateIPsecSiteConnection(forms.SelfHandlingForm):
name = forms.CharField(max_length=80, label=_("Name"), required=False)
ipsecsiteconnection_id = forms.CharField(
label=_("ID"),
@ -287,7 +287,7 @@ class UpdateIPSecSiteConnection(forms.SelfHandlingForm):
peer_ep_group_id = forms.CharField(
required=False,
label=_("Peer Endpoint Group(s)"),
help_text=_("IPSec connection validation requires "
help_text=_("IPsec connection validation requires "
"that peer endpoints are CIDRs"))
psk = forms.CharField(
widget=forms.PasswordInput(render_value=True),
@ -328,7 +328,7 @@ class UpdateIPSecSiteConnection(forms.SelfHandlingForm):
failure_url = 'horizon:project:vpn:index'
def clean(self):
cleaned_data = super(UpdateIPSecSiteConnection, self).clean()
cleaned_data = super(UpdateIPsecSiteConnection, self).clean()
interval = cleaned_data.get('dpd_interval')
timeout = cleaned_data.get('dpd_timeout')
@ -362,14 +362,14 @@ class UpdateIPSecSiteConnection(forms.SelfHandlingForm):
ipsecsiteconnection = api_vpn.ipsecsiteconnection_update(
request, context['ipsecsiteconnection_id'],
ipsec_site_connection=data)
msg = (_('IPSec Site Connection %s was successfully updated.')
msg = (_('IPsec site connection %s was successfully updated.')
% context['name'])
messages.success(request, msg)
return ipsecsiteconnection
except Exception as e:
LOG.info('Failed to update IPSec Site Connection %(id)s: %(exc)s',
LOG.info('Failed to update IPsec site connection %(id)s: %(exc)s',
{'id': context['ipsecsiteconnection_id'], 'exc': e})
msg = (_('Failed to update IPSec Site Connection %s')
msg = (_('Failed to update IPsec site connection %s')
% context['name'])
redirect = reverse(self.failure_url)
exceptions.handle(request, msg, redirect=redirect)

View File

@ -39,9 +39,9 @@ class AddIKEPolicyLink(tables.LinkAction):
policy_rules = (("network", "create_ikepolicy"),)
class AddIPSecPolicyLink(tables.LinkAction):
class AddIPsecPolicyLink(tables.LinkAction):
name = "addipsecpolicy"
verbose_name = _("Add IPSec Policy")
verbose_name = _("Add IPsec Policy")
url = "horizon:project:vpn:addipsecpolicy"
classes = ("ajax-modal",)
icon = "plus"
@ -66,9 +66,9 @@ class AddEndpointGroupLink(tables.LinkAction):
policy_rules = (("network", "create_endpointgroup"),)
class AddIPSecSiteConnectionLink(tables.LinkAction):
class AddIPsecSiteConnectionLink(tables.LinkAction):
name = "addipsecsiteconnection"
verbose_name = _("Add IPSec Site Connection")
verbose_name = _("Add IPsec Site Connection")
url = "horizon:project:vpn:addipsecsiteconnection"
classes = ("ajax-modal",)
icon = "plus"
@ -90,8 +90,8 @@ class DeleteVPNServiceLink(policy.PolicyTargetMixin, tables.DeleteAction):
@staticmethod
def action_past(count):
return ungettext_lazy(
u"Scheduled deletion of VPN Service",
u"Scheduled deletion of VPN Services",
u"Scheduled deletion of VPN service",
u"Scheduled deletion of VPN services",
count
)
@ -105,7 +105,7 @@ class DeleteVPNServiceLink(policy.PolicyTargetMixin, tables.DeleteAction):
api_vpn.vpnservice_delete(request, obj_id)
except Exception as e:
exceptions.handle(
request, _('Unable to delete VPN Service. %s') % e)
request, _('Unable to delete VPN service. %s') % e)
class DeleteEndpointGroupLink(policy.PolicyTargetMixin, tables.DeleteAction):
@ -151,8 +151,8 @@ class DeleteIKEPolicyLink(policy.PolicyTargetMixin, tables.DeleteAction):
@staticmethod
def action_past(count):
return ungettext_lazy(
u"Scheduled deletion of IKE Policy",
u"Scheduled deletion of IKE Policies",
u"Scheduled deletion of IKE policy",
u"Scheduled deletion of IKE policies",
count
)
@ -166,26 +166,26 @@ class DeleteIKEPolicyLink(policy.PolicyTargetMixin, tables.DeleteAction):
api_vpn.ikepolicy_delete(request, obj_id)
except Exception as e:
exceptions.handle(
request, _('Unable to delete IKE Policy. %s') % e)
request, _('Unable to delete IKE policy. %s') % e)
class DeleteIPSecPolicyLink(policy.PolicyTargetMixin, tables.DeleteAction):
class DeleteIPsecPolicyLink(policy.PolicyTargetMixin, tables.DeleteAction):
name = "deleteipsecpolicy"
policy_rules = (("network", "delete_ipsecpolicy"),)
@staticmethod
def action_present(count):
return ungettext_lazy(
u"Delete IPSec Policy",
u"Delete IPSec Policies",
u"Delete IPsec Policy",
u"Delete IPsec Policies",
count
)
@staticmethod
def action_past(count):
return ungettext_lazy(
u"Scheduled deletion of IPSec Policy",
u"Scheduled deletion of IPSec Policies",
u"Scheduled deletion of IPsec policy",
u"Scheduled deletion of IPsec policies",
count
)
@ -199,10 +199,10 @@ class DeleteIPSecPolicyLink(policy.PolicyTargetMixin, tables.DeleteAction):
api_vpn.ipsecpolicy_delete(request, obj_id)
except Exception as e:
exceptions.handle(
request, _('Unable to delete IPSec Policy. %s') % e)
request, _('Unable to delete IPsec policy. %s') % e)
class DeleteIPSecSiteConnectionLink(policy.PolicyTargetMixin,
class DeleteIPsecSiteConnectionLink(policy.PolicyTargetMixin,
tables.DeleteAction):
name = "deleteipsecsiteconnection"
policy_rules = (("network", "delete_ipsec_site_connection"),)
@ -210,16 +210,16 @@ class DeleteIPSecSiteConnectionLink(policy.PolicyTargetMixin,
@staticmethod
def action_present(count):
return ungettext_lazy(
u"Delete IPSec Site Connection",
u"Delete IPSec Site Connections",
u"Delete IPsec Site Connection",
u"Delete IPsec Site Connections",
count
)
@staticmethod
def action_past(count):
return ungettext_lazy(
u"Scheduled deletion of IPSec Site Connection",
u"Scheduled deletion of IPSec Site Connections",
u"Scheduled deletion of IPsec site connection",
u"Scheduled deletion of IPsec site connections",
count
)
@ -228,7 +228,7 @@ class DeleteIPSecSiteConnectionLink(policy.PolicyTargetMixin,
api_vpn.ipsecsiteconnection_delete(request, obj_id)
except Exception as e:
exceptions.handle(
request, _('Unable to delete IPSec Site Connection. %s') % e)
request, _('Unable to delete IPsec site connection. %s') % e)
class UpdateVPNServiceLink(tables.LinkAction):
@ -272,9 +272,9 @@ class UpdateIKEPolicyLink(tables.LinkAction):
return not datum['ipsecsiteconns']
class UpdateIPSecPolicyLink(tables.LinkAction):
class UpdateIPsecPolicyLink(tables.LinkAction):
name = "updateipsecpolicy"
verbose_name = _("Edit IPSec Policy")
verbose_name = _("Edit IPsec Policy")
classes = ("ajax-modal", "btn-update",)
policy_rules = (("network", "update_ipsecpolicy"),)
@ -286,7 +286,7 @@ class UpdateIPSecPolicyLink(tables.LinkAction):
return not datum['ipsecsiteconns']
class UpdateIPSecSiteConnectionLink(tables.LinkAction):
class UpdateIPsecSiteConnectionLink(tables.LinkAction):
name = "updateipsecsiteconnection"
verbose_name = _("Edit Connection")
classes = ("ajax-modal", "btn-update",)
@ -313,29 +313,34 @@ STATUS_CHOICES = (
STATUS_DISPLAY_CHOICES = (
("active", pgettext_lazy("Current status of an IPSec Site Connection"
" and VPN Service", u"Active")),
("down", pgettext_lazy("Current status of an IPSec Site Connection"
" and VPN Service", u"Down")),
("error", pgettext_lazy("Current status of an IPSec Site Connection"
" and VPN Service", u"Error")),
("created", pgettext_lazy("Current status of an IPSec Site Connection"
" and VPN Service", u"Created")),
("active", pgettext_lazy("Current status of an IPsec site connection "
"and VPN service",
u"Active")),
("down", pgettext_lazy("Current status of an IPsec site connection "
"and VPN service",
u"Down")),
("error", pgettext_lazy("Current status of an IPsec site connection "
"and VPN service",
u"Error")),
("created", pgettext_lazy("Current status of an IPsec site connection "
"and VPN service",
u"Created")),
("pending_create", pgettext_lazy("Current status of an "
" IPSec Site Connection and VPN Service",
"IPsec site connection and VPN service",
u"Pending Create")),
("pending_update", pgettext_lazy("Current status of an "
" IPSec Site Connection and VPN Service",
"IPsec site connection and VPN service",
u"Pending Update")),
("pending_delete", pgettext_lazy("Current status of an "
" IPSec Site Connection and VPN Service",
"IPsec site connection and VPN service",
u"Pending Delete")),
("inactive", pgettext_lazy("Current status of an IPSec Site Connection"
" and VPN Service", u"Inactive")),
("inactive", pgettext_lazy("Current status of an IPsec site connection "
"and VPN service",
u"Inactive")),
)
class UpdateIPSecSiteConnectionRow(tables.Row):
class UpdateIPsecSiteConnectionRow(tables.Row):
ajax = True
def get_data(self, request, conn_id):
@ -358,13 +363,13 @@ class IPSSCFilterAction(tables.FilterAction):
('vpnservice_id', _("VPN Service ID ="), True),
('ikepolicy', _("IKE Policy ="), True),
('ikepolicy_id', _("IKE Policy ID ="), True),
('ipsecpolicy', _("IPSec Policy ="), True),
('ipsecpolicy_id', _("IPSec Policy ID ="), True),
('ipsecpolicy', _("IPsec Policy ="), True),
('ipsecpolicy_id', _("IPsec Policy ID ="), True),
('status', _("Status ="), True)
)
class IPSecSiteConnectionsTable(tables.DataTable):
class IPsecSiteConnectionsTable(tables.DataTable):
id = tables.Column('id', hidden=True)
name = tables.Column('name_or_id', verbose_name=_('Name'),
link="horizon:project:vpn:ipsecsiteconnectiondetails")
@ -374,7 +379,7 @@ class IPSecSiteConnectionsTable(tables.DataTable):
ikepolicy_name = tables.Column('ikepolicy_name',
verbose_name=_('IKE Policy'))
ipsecpolicy_name = tables.Column('ipsecpolicy_name',
verbose_name=_('IPSec Policy'))
verbose_name=_('IPsec Policy'))
status = tables.Column("status",
verbose_name=_("Status"),
status=True,
@ -386,14 +391,14 @@ class IPSecSiteConnectionsTable(tables.DataTable):
class Meta(object):
name = "ipsecsiteconnectionstable"
verbose_name = _("IPSec Site Connections")
verbose_name = _("IPsec Site Connections")
status_columns = ['status']
row_class = UpdateIPSecSiteConnectionRow
table_actions = (AddIPSecSiteConnectionLink,
DeleteIPSecSiteConnectionLink,
row_class = UpdateIPsecSiteConnectionRow
table_actions = (AddIPsecSiteConnectionLink,
DeleteIPsecSiteConnectionLink,
IPSSCFilterAction)
row_actions = (UpdateIPSecSiteConnectionLink,
DeleteIPSecSiteConnectionLink)
row_actions = (UpdateIPsecSiteConnectionLink,
DeleteIPsecSiteConnectionLink)
def get_local_ips(vpn):
@ -531,7 +536,7 @@ class IKEPoliciesTable(tables.DataTable):
row_actions = (UpdateIKEPolicyLink, DeleteIKEPolicyLink)
class IPSecPoliciesTable(tables.DataTable):
class IPsecPoliciesTable(tables.DataTable):
id = tables.Column('id', hidden=True)
name = tables.Column("name_or_id", verbose_name=_('Name'),
link="horizon:project:vpn:ipsecpolicydetails")
@ -548,8 +553,8 @@ class IPSecPoliciesTable(tables.DataTable):
class Meta(object):
name = "ipsecpoliciestable"
verbose_name = _("IPSec Policies")
table_actions = (AddIPSecPolicyLink,
DeleteIPSecPolicyLink,
verbose_name = _("IPsec Policies")
table_actions = (AddIPsecPolicyLink,
DeleteIPsecPolicyLink,
PoliciesFilterAction)
row_actions = (UpdateIPSecPolicyLink, DeleteIPSecPolicyLink)
row_actions = (UpdateIPsecPolicyLink, DeleteIPsecPolicyLink)

View File

@ -24,9 +24,9 @@ from neutron_vpnaas_dashboard.api import vpn as api_vpn
from neutron_vpnaas_dashboard.dashboards.project.vpn import tables
class IPSecSiteConnectionsTab(tabs.TableTab, htables.DataTableView):
table_classes = (tables.IPSecSiteConnectionsTable,)
name = _("IPSec Site Connections")
class IPsecSiteConnectionsTab(tabs.TableTab, htables.DataTableView):
table_classes = (tables.IPsecSiteConnectionsTable,)
name = _("IPsec Site Connections")
slug = "ipsecsiteconnections"
template_name = ("horizon/common/_detail_table.html")
FILTERS_MAPPING = {'admin_state_up': {_("up"): True, _("down"): False}}
@ -59,7 +59,7 @@ class IPSecSiteConnectionsTab(tabs.TableTab, htables.DataTableView):
ipsecsiteconnections = []
exceptions.handle(
self.tab_group.request,
_('Unable to retrieve IPSec Site Connections list.'))
_('Unable to retrieve IPsec site connections list.'))
return ipsecsiteconnections
def get_filters(self):
@ -67,7 +67,7 @@ class IPSecSiteConnectionsTab(tabs.TableTab, htables.DataTableView):
self.handle_server_filter(self.request, table=self.table)
self.update_server_filter_action(self.request, table=self.table)
return super(IPSecSiteConnectionsTab,
return super(IPsecSiteConnectionsTab,
self).get_filters(filters_map=self.FILTERS_MAPPING)
@ -103,7 +103,7 @@ class VPNServicesTab(tabs.TableTab, htables.DataTableView):
except Exception:
vpnservices = []
exceptions.handle(self.tab_group.request,
_('Unable to retrieve VPN Services list.'))
_('Unable to retrieve VPN services list.'))
return vpnservices
def get_filters(self):
@ -155,7 +155,7 @@ class IKEPoliciesTab(tabs.TableTab, htables.DataTableView):
except Exception:
ikepolicies = []
exceptions.handle(self.tab_group.request,
_('Unable to retrieve IKE Policies list.'))
_('Unable to retrieve IKE policies list.'))
return ikepolicies
def get_filters(self):
@ -166,9 +166,9 @@ class IKEPoliciesTab(tabs.TableTab, htables.DataTableView):
return super(IKEPoliciesTab, self).get_filters()
class IPSecPoliciesTab(tabs.TableTab, htables.DataTableView):
table_classes = (tables.IPSecPoliciesTable,)
name = _("IPSec Policies")
class IPsecPoliciesTab(tabs.TableTab, htables.DataTableView):
table_classes = (tables.IPsecPoliciesTable,)
name = _("IPsec Policies")
slug = "ipsecpolicies"
template_name = ("horizon/common/_detail_table.html")
@ -181,7 +181,7 @@ class IPSecPoliciesTab(tabs.TableTab, htables.DataTableView):
except Exception:
ipsecpolicies = []
exceptions.handle(self.tab_group.request,
_('Unable to retrieve IPSec Policies list.'))
_('Unable to retrieve IPsec policy list.'))
return ipsecpolicies
def get_filters(self):
@ -189,14 +189,14 @@ class IPSecPoliciesTab(tabs.TableTab, htables.DataTableView):
self.handle_server_filter(self.request, table=self.table)
self.update_server_filter_action(self.request, table=self.table)
return super(IPSecPoliciesTab, self).get_filters()
return super(IPsecPoliciesTab, self).get_filters()
class VPNTabs(tabs.TabGroup):
slug = "vpntabs"
tabs = (IKEPoliciesTab, IPSecPoliciesTab,
tabs = (IKEPoliciesTab, IPsecPoliciesTab,
VPNServicesTab, EndpointGroupTab,
IPSecSiteConnectionsTab,)
IPsecSiteConnectionsTab,)
sticky = True
@ -215,8 +215,8 @@ class IKEPolicyDetailsTabs(tabs.TabGroup):
tabs = (IKEPolicyDetailsTab,)
class IPSecPolicyDetailsTab(tabs.Tab):
name = _("IPSec Policy Details")
class IPsecPolicyDetailsTab(tabs.Tab):
name = _("IPsec Policy Details")
slug = "ipsecpolicydetails"
template_name = "project/vpn/_ipsecpolicy_details.html"
@ -225,9 +225,9 @@ class IPSecPolicyDetailsTab(tabs.Tab):
return {'ipsecpolicy': ipsecpolicy}
class IPSecPolicyDetailsTabs(tabs.TabGroup):
class IPsecPolicyDetailsTabs(tabs.TabGroup):
slug = "ipsecpolicytabs"
tabs = (IPSecPolicyDetailsTab,)
tabs = (IPsecPolicyDetailsTab,)
class VPNServiceDetailsTab(tabs.Tab):
@ -260,8 +260,8 @@ class EndpointGroupDetailsTabs(tabs.TabGroup):
tabs = (EndpointGroupDetailsTab,)
class IPSecSiteConnectionDetailsTab(tabs.Tab):
name = _("IPSec Site Connection Details")
class IPsecSiteConnectionDetailsTab(tabs.Tab):
name = _("IPsec Site Connection Details")
slug = "ipsecsiteconnectiondetails"
template_name = "project/vpn/_ipsecsiteconnection_details.html"
@ -270,6 +270,6 @@ class IPSecSiteConnectionDetailsTab(tabs.Tab):
return {'ipsecsiteconnection': ipsecsiteconnection}
class IPSecSiteConnectionDetailsTabs(tabs.TabGroup):
class IPsecSiteConnectionDetailsTabs(tabs.TabGroup):
slug = "ipsecsiteconnectiontabs"
tabs = (IPSecSiteConnectionDetailsTab,)
tabs = (IPsecSiteConnectionDetailsTab,)

View File

@ -1,12 +1,12 @@
{% load i18n %}
<p>{% trans "Create IKE Policy for current project." %}</p>
<p>{% trans "Create IKE policy for current project." %}</p>
<p>{% trans "An IKE policy is an association of the following attributes:" %}</p>
<dl class="dl-readable">
<dt>{% trans 'Authorization algorithm' %}</dt>
<dd>{% trans 'Auth algorithm limited to SHA1 only.' %}</dd>
<dt>{% trans 'Encryption algorithm' %}</dt>
<dd>{% trans 'The type of algorithm (3des, aes-128, aes-192, aes-256) used in the IKE Policy.' %}</dd>
<dd>{% trans 'The type of algorithm (3des, aes-128, aes-192, aes-256) used in the IKE policy.' %}</dd>
<dt>{% trans 'IKE version' %}</dt>
<dd>{% trans 'The type of version (v1/v2) that needs to be filtered.' %}</dd>
<dt>{% trans 'Lifetime' %}</dt>

View File

@ -1,19 +1,19 @@
{% load i18n %}
<p>{% trans 'Create IPSec Policy for current project.' %}</p>
<p>{% trans 'An IPSec policy is an association of the following attributes' %}</p>
<p>{% trans 'Create IPsec policy for current project.' %}</p>
<p>{% trans 'An IPsec policy is an association of the following attributes' %}</p>
<dl class="dl-readable">
<dt>{% trans 'Authorization algorithm' %}</dt>
<dd>{% trans 'Auth algorithm limited to SHA1 only.' %}</dd>
<dt>{% trans 'Encapsulation mode' %}</dt>
<dd>{% trans 'The type of IPsec tunnel (tunnel/transport) to be used.' %}</dd>
<dt>{% trans 'Encryption algorithm' %}</dt>
<dd>{% trans 'The type of algorithm (3des, aes-128, aes-192, aes-256) used in the IPSec Policy.' %}</dd>
<dd>{% trans 'The type of algorithm (3des, aes-128, aes-192, aes-256) used in the IPsec policy.' %}</dd>
<dt>{% trans 'Lifetime' %}</dt>
<dd>{% trans "Life time consists of units and value. Units in 'seconds' and the default value is 3600." %}</dd>
<dt>{% trans 'Perfect Forward Secrecy' %}</dt>
<dd>{% trans 'PFS limited to using Diffie-Hellman groups 2, 5 (default) and 14.' %}</dd>
<dt>{% trans 'Transform Protocol' %}</dt>
<dd>{% trans 'The type of protocol (esp, ah, ah-esp) used in IPSec Policy.' %}</dd>
<dd>{% trans 'The type of protocol (esp, ah, ah-esp) used in IPsec policy.' %}</dd>
</dl>
<p>{% trans 'All fields are optional.' %}</p>

View File

@ -5,7 +5,7 @@
The VPN service is attached to a router and references to endpoint group
or a single subnet to push to a remote site.
{% endblocktrans %}</p>
<p>{% trans "Specify a name, description, router, and subnet (optional) for the VPN Service." %}</p>
<p>{% trans "Specify a name, description, router, and subnet (optional) for the VPN service." %}</p>
<p>{% trans "Admin State is enabled by default." %}</p>
<p>{% trans "The router and admin state fields require to be enabled. All others are optional." %} </p>
<p>{% blocktrans trimmed %}

View File

@ -26,7 +26,7 @@
{% url 'horizon:project:vpn:ikepolicydetails' ipsecsiteconnection.ikepolicy_id as ikepolicy_url %}
<dd><a href="{{ ikepolicy_url }}">{{ ipsecsiteconnection.ikepolicy.name_or_id }}</a></dd>
<dt>{% trans "IPSec Policy" %}</dt>
<dt>{% trans "IPsec Policy" %}</dt>
{% url 'horizon:project:vpn:ipsecpolicydetails' ipsecsiteconnection.ipsecpolicy_id as ipsecpolicy_url %}
<dd><a href="{{ ipsecpolicy_url }}">{{ ipsecsiteconnection.ipsecpolicy.name_or_id }}</a></dd>

View File

@ -3,5 +3,5 @@
{% block modal-body-right %}
<h3>{% trans "Description:" %}</h3>
<p>{% trans "You may update IKE Policy details here." %}</p>
<p>{% trans "You may update IKE policy details here." %}</p>
{% endblock %}

View File

@ -3,5 +3,5 @@
{% block modal-body-right %}
<h3>{% trans "Description:" %}</h3>
<p>{% trans "You may update IPSec Policy details here." %}</p>
<p>{% trans "You may update IPsec policy details here." %}</p>
{% endblock %}

View File

@ -3,5 +3,5 @@
{% block modal-body-right %}
<h3>{% trans "Description:" %}</h3>
<p>{% trans "You may update IPSec Site Connection details here." %}</p>
<p>{% trans "You may update IPsec site connection details here." %}</p>
{% endblock %}

View File

@ -3,5 +3,5 @@
{% block modal-body-right %}
<h3>{% trans "Description:" %}</h3>
<p>{% trans "You may update VPN Service details here." %}</p>
<p>{% trans "You may update VPN service details here." %}</p>
{% endblock %}

View File

@ -1,6 +1,6 @@
{% extends 'base.html' %}
{% load i18n %}
{% block title %}{% trans "Edit IPSec Policy" %}{% endblock %}
{% block title %}{% trans "Edit IPsec policy" %}{% endblock %}
{% block main %}
{% include 'project/vpn/_update_ipsecpolicy.html' %}

View File

@ -1,6 +1,6 @@
{% extends 'base.html' %}
{% load i18n %}
{% block title %}{% trans "Edit IPSec Site Connection" %}{% endblock %}
{% block title %}{% trans "Edit IPsec site connection" %}{% endblock %}
{% block main %}
{% include 'project/vpn/_update_ipsecsiteconnection.html' %}

View File

@ -461,9 +461,9 @@ class VPNTests(test.TestCase):
workflow = res.context['workflow']
self.assertTemplateUsed(res, views.WorkflowView.template_name)
self.assertEqual(workflow.name, workflows.AddIPSecPolicy.name)
self.assertEqual(workflow.name, workflows.AddIPsecPolicy.name)
expected_objs = ['<AddIPSecPolicyStep: addipsecpolicyaction>', ]
expected_objs = ['<AddIPsecPolicyStep: addipsecpolicyaction>', ]
self.assertQuerysetEqual(workflow.steps, expected_objs)
@test.create_stubs({api_vpn: ('ipsecpolicy_create', )})
@ -536,11 +536,11 @@ class VPNTests(test.TestCase):
workflow = res.context['workflow']
self.assertTemplateUsed(res, views.WorkflowView.template_name)
self.assertEqual(workflow.name, workflows.AddIPSecSiteConnection.name)
self.assertEqual(workflow.name, workflows.AddIPsecSiteConnection.name)
expected_objs = ['<AddIPSecSiteConnectionStep: '
expected_objs = ['<AddIPsecSiteConnectionStep: '
'addipsecsiteconnectionaction>',
'<AddIPSecSiteConnectionOptionalStep: '
'<AddIPsecSiteConnectionOptionalStep: '
'addipsecsiteconnectionoptionalaction>', ]
self.assertQuerysetEqual(workflow.steps, expected_objs)

View File

@ -23,14 +23,14 @@ urlpatterns = [
url(r'^update_ikepolicy/(?P<ikepolicy_id>[^/]+)/$',
views.UpdateIKEPolicyView.as_view(), name='update_ikepolicy'),
url(r'^addipsecpolicy$',
views.AddIPSecPolicyView.as_view(), name='addipsecpolicy'),
views.AddIPsecPolicyView.as_view(), name='addipsecpolicy'),
url(r'^update_ipsecpolicy/(?P<ipsecpolicy_id>[^/]+)/$',
views.UpdateIPSecPolicyView.as_view(), name='update_ipsecpolicy'),
views.UpdateIPsecPolicyView.as_view(), name='update_ipsecpolicy'),
url(r'^addipsecsiteconnection$',
views.AddIPSecSiteConnectionView.as_view(),
views.AddIPsecSiteConnectionView.as_view(),
name='addipsecsiteconnection'),
url(r'^update_ipsecsiteconnection/(?P<ipsecsiteconnection_id>[^/]+)/$',
views.UpdateIPSecSiteConnectionView.as_view(),
views.UpdateIPsecSiteConnectionView.as_view(),
name='update_ipsecsiteconnection'),
url(r'^addvpnservice$',
views.AddVPNServiceView.as_view(), name='addvpnservice'),
@ -43,12 +43,12 @@ urlpatterns = [
url(r'^ikepolicy/(?P<ikepolicy_id>[^/]+)/$',
views.IKEPolicyDetailsView.as_view(), name='ikepolicydetails'),
url(r'^ipsecpolicy/(?P<ipsecpolicy_id>[^/]+)/$',
views.IPSecPolicyDetailsView.as_view(), name='ipsecpolicydetails'),
views.IPsecPolicyDetailsView.as_view(), name='ipsecpolicydetails'),
url(r'^vpnservice/(?P<vpnservice_id>[^/]+)/$',
views.VPNServiceDetailsView.as_view(), name='vpnservicedetails'),
url(r'^endpointgroup/(?P<endpoint_group_id>[^/]+)/$',
views.EndpointGroupDetailsView.as_view(), name='endpointgroupdetails'),
url(r'^ipsecsiteconnection/(?P<ipsecsiteconnection_id>[^/]+)/$',
views.IPSecSiteConnectionDetailsView.as_view(),
views.IPsecSiteConnectionDetailsView.as_view(),
name='ipsecsiteconnectiondetails'),
]

View File

@ -43,16 +43,16 @@ class AddEndpointGroupView(horizon_workflows.WorkflowView):
workflow_class = workflows.AddEndpointGroup
class AddIPSecSiteConnectionView(horizon_workflows.WorkflowView):
workflow_class = workflows.AddIPSecSiteConnection
class AddIPsecSiteConnectionView(horizon_workflows.WorkflowView):
workflow_class = workflows.AddIPsecSiteConnection
class AddIKEPolicyView(horizon_workflows.WorkflowView):
workflow_class = workflows.AddIKEPolicy
class AddIPSecPolicyView(horizon_workflows.WorkflowView):
workflow_class = workflows.AddIPSecPolicy
class AddIPsecPolicyView(horizon_workflows.WorkflowView):
workflow_class = workflows.AddIPsecPolicy
class IKEPolicyDetailsView(horizon_tabs.TabView):
@ -66,7 +66,7 @@ class IKEPolicyDetailsView(horizon_tabs.TabView):
try:
return api_vpn.ikepolicy_get(self.request, pid)
except Exception:
msg = _('Unable to retrieve IKE Policy details.')
msg = _('Unable to retrieve IKE policy details.')
exceptions.handle(self.request, msg,
redirect=self.get_redirect_url())
@ -88,8 +88,8 @@ class IKEPolicyDetailsView(horizon_tabs.TabView):
return reverse_lazy('horizon:project:vpn:index')
class IPSecPolicyDetailsView(horizon_tabs.TabView):
tab_group_class = tabs.IPSecPolicyDetailsTabs
class IPsecPolicyDetailsView(horizon_tabs.TabView):
tab_group_class = tabs.IPsecPolicyDetailsTabs
template_name = 'horizon/common/_detail.html'
page_title = "{{ ipsecpolicy.name|default:ipsecpolicy.id }}"
@ -99,15 +99,15 @@ class IPSecPolicyDetailsView(horizon_tabs.TabView):
try:
return api_vpn.ipsecpolicy_get(self.request, pid)
except Exception:
msg = _('Unable to retrieve IPSec Policy details.')
msg = _('Unable to retrieve IPsec policy details.')
exceptions.handle(self.request, msg,
redirect=self.get_redirect_url())
def get_context_data(self, **kwargs):
context = super(IPSecPolicyDetailsView, self).get_context_data(
context = super(IPsecPolicyDetailsView, self).get_context_data(
**kwargs)
ipsecpolicy = self.get_data()
table = tables.IPSecPoliciesTable(self.request)
table = tables.IPsecPoliciesTable(self.request)
context["ipsecpolicy"] = ipsecpolicy
context["url"] = self.get_redirect_url()
context["actions"] = table.render_row_actions(ipsecpolicy)
@ -135,7 +135,7 @@ class VPNServiceDetailsView(horizon_tabs.TabView):
vpnservice = api_vpn.vpnservice_get(self.request, sid)
except Exception:
vpnservice = []
msg = _('Unable to retrieve VPN Service details.')
msg = _('Unable to retrieve VPN service details.')
exceptions.handle(self.request, msg,
redirect=self.get_redirect_url())
try:
@ -209,8 +209,8 @@ class EndpointGroupDetailsView(horizon_tabs.TabView):
return reverse('horizon:project:vpn:index')
class IPSecSiteConnectionDetailsView(horizon_tabs.TabView):
tab_group_class = tabs.IPSecSiteConnectionDetailsTabs
class IPsecSiteConnectionDetailsView(horizon_tabs.TabView):
tab_group_class = tabs.IPsecSiteConnectionDetailsTabs
template_name = 'horizon/common/_detail.html'
page_title = "{{ ipsecsiteconnection.name|default:ipsecsiteconnection.id}}"
@ -220,15 +220,15 @@ class IPSecSiteConnectionDetailsView(horizon_tabs.TabView):
try:
return api_vpn.ipsecsiteconnection_get(self.request, cid)
except Exception:
msg = _('Unable to retrieve IPSec Site Connection details.')
msg = _('Unable to retrieve IPsec site connection details.')
exceptions.handle(self.request, msg,
redirect=self.get_redirect_url())
def get_context_data(self, **kwargs):
context = super(IPSecSiteConnectionDetailsView, self).get_context_data(
context = super(IPsecSiteConnectionDetailsView, self).get_context_data(
**kwargs)
ipsecsiteconnection = self.get_data()
table = tables.IPSecSiteConnectionsTable(self.request)
table = tables.IPsecSiteConnectionsTable(self.request)
context["ipsecsiteconnection"] = ipsecsiteconnection
context["url"] = self.get_redirect_url()
context["actions"] = table.render_row_actions(ipsecsiteconnection)
@ -269,7 +269,7 @@ class UpdateVPNServiceView(horizon_forms.ModalFormView):
return api_vpn.vpnservice_get(self.request, vpnservice_id)
except Exception as e:
redirect = self.success_url
msg = _('Unable to retrieve VPN Service details. %s') % e
msg = _('Unable to retrieve VPN service details. %s') % e
exceptions.handle(self.request, msg, redirect=redirect)
def get_initial(self):
@ -339,7 +339,7 @@ class UpdateIKEPolicyView(horizon_forms.ModalFormView):
return api_vpn.ikepolicy_get(self.request, ikepolicy_id)
except Exception as e:
redirect = self.success_url
msg = _('Unable to retrieve IKE Policy details. %s') % e
msg = _('Unable to retrieve IKE policy details. %s') % e
exceptions.handle(self.request, msg, redirect=redirect)
def get_initial(self):
@ -357,18 +357,18 @@ class UpdateIKEPolicyView(horizon_forms.ModalFormView):
'phase1_negotiation_mode']}
class UpdateIPSecPolicyView(horizon_forms.ModalFormView):
form_class = forms.UpdateIPSecPolicy
class UpdateIPsecPolicyView(horizon_forms.ModalFormView):
form_class = forms.UpdateIPsecPolicy
form_id = "update_ipsecpolicy_form"
template_name = "project/vpn/update_ipsecpolicy.html"
context_object_name = 'ipsecpolicy'
submit_label = _("Save Changes")
submit_url = "horizon:project:vpn:update_ipsecpolicy"
success_url = reverse_lazy("horizon:project:vpn:index")
page_title = _("Edit IPSec Policy")
page_title = _("Edit IPsec Policy")
def get_context_data(self, **kwargs):
context = super(UpdateIPSecPolicyView, self).get_context_data(**kwargs)
context = super(UpdateIPsecPolicyView, self).get_context_data(**kwargs)
context["ipsecpolicy_id"] = self.kwargs['ipsecpolicy_id']
args = (self.kwargs['ipsecpolicy_id'],)
context['submit_url'] = reverse(self.submit_url, args=args)
@ -381,7 +381,7 @@ class UpdateIPSecPolicyView(horizon_forms.ModalFormView):
return api_vpn.ipsecpolicy_get(self.request, ipsecpolicy_id)
except Exception as e:
redirect = self.success_url
msg = _('Unable to retrieve IPSec Policy details. %s') % e
msg = _('Unable to retrieve IPsec policy details. %s') % e
exceptions.handle(self.request, msg, redirect=redirect)
def get_initial(self):
@ -398,19 +398,19 @@ class UpdateIPSecPolicyView(horizon_forms.ModalFormView):
'transform_protocol': ipsecpolicy['transform_protocol']}
class UpdateIPSecSiteConnectionView(horizon_forms.ModalFormView):
form_class = forms.UpdateIPSecSiteConnection
class UpdateIPsecSiteConnectionView(horizon_forms.ModalFormView):
form_class = forms.UpdateIPsecSiteConnection
form_id = "update_ipsecsiteconnection_form"
template_name = "project/vpn/update_ipsecsiteconnection.html"
context_object_name = 'ipsecsiteconnection'
submit_label = _("Save Changes")
submit_url = "horizon:project:vpn:update_ipsecsiteconnection"
success_url = reverse_lazy("horizon:project:vpn:index")
page_title = _("Edit IPSec Site Connection")
page_title = _("Edit IPsec Site Connection")
def get_context_data(self, **kwargs):
context = super(
UpdateIPSecSiteConnectionView, self).get_context_data(**kwargs)
UpdateIPsecSiteConnectionView, self).get_context_data(**kwargs)
context["ipsecsiteconnection_id"] = self.kwargs[
'ipsecsiteconnection_id']
args = (self.kwargs['ipsecsiteconnection_id'],)
@ -424,7 +424,7 @@ class UpdateIPSecSiteConnectionView(horizon_forms.ModalFormView):
return api_vpn.ipsecsiteconnection_get(self.request, connection_id)
except Exception as e:
redirect = self.success_url
msg = _('Unable to retrieve IPSec Site Connection details. %s') % e
msg = _('Unable to retrieve IPsec site connection details. %s') % e
exceptions.handle(self.request, msg, redirect=redirect)
def get_initial(self):

View File

@ -94,8 +94,8 @@ class AddVPNService(workflows.Workflow):
slug = "addvpnservice"
name = _("Add VPN Service")
finalize_button_name = _("Add")
success_message = _('Added VPN Service "%s".')
failure_message = _('Unable to add VPN Service "%s".')
success_message = _('Added VPN service "%s".')
failure_message = _('Unable to add VPN service "%s".')
success_url = "horizon:project:vpn:index"
default_steps = (AddVPNServiceStep,)
@ -122,7 +122,7 @@ class AddEndpointGroupAction(workflows.Action):
label=_("Description"))
type = forms.ThemableChoiceField(
label=_("Type"),
help_text=_("IPSec connection validation requires that local "
help_text=_("IPsec connection validation requires that local "
"endpoints are subnets, and peer endpoints are CIDRs."),
choices=[('cidr', _('CIDR (for external systems)')),
('subnet', _('Subnet (for local systems)'))],
@ -298,8 +298,8 @@ class AddIKEPolicy(workflows.Workflow):
slug = "addikepolicy"
name = _("Add IKE Policy")
finalize_button_name = _("Add")
success_message = _('Added IKE Policy "%s".')
failure_message = _('Unable to add IKE Policy "%s".')
success_message = _('Added IKE policy "%s".')
failure_message = _('Unable to add IKE policy "%s".')
success_url = "horizon:project:vpn:index"
default_steps = (AddIKEPolicyStep,)
@ -314,7 +314,7 @@ class AddIKEPolicy(workflows.Workflow):
return False
class AddIPSecPolicyAction(workflows.Action):
class AddIPsecPolicyAction(workflows.Action):
name = forms.CharField(max_length=80, label=_("Name"), required=False)
description = forms.CharField(
initial="", required=False,
@ -337,7 +337,7 @@ class AddIPSecPolicyAction(workflows.Action):
required=False)
def __init__(self, request, *args, **kwargs):
super(AddIPSecPolicyAction, self).__init__(request, *args, **kwargs)
super(AddIPsecPolicyAction, self).__init__(request, *args, **kwargs)
auth_algorithm_choices = [("sha1", "sha1")]
self.fields['auth_algorithm'].choices = auth_algorithm_choices
@ -373,20 +373,20 @@ class AddIPSecPolicyAction(workflows.Action):
self.fields['transform_protocol'].choices = transform_protocol_choices
class Meta(object):
name = _("Add New IPSec Policy")
name = _("Add New IPsec Policy")
permissions = ('openstack.services.network',)
help_text_template = 'project/vpn/_add_ipsec_policy_help.html'
class AddIPSecPolicyStep(workflows.Step):
action_class = AddIPSecPolicyAction
class AddIPsecPolicyStep(workflows.Step):
action_class = AddIPsecPolicyAction
contributes = ("name", "description", "auth_algorithm",
"encapsulation_mode", "encryption_algorithm",
"lifetime_units", "lifetime_value",
"pfs", "transform_protocol")
def contribute(self, data, context):
context = super(AddIPSecPolicyStep, self).contribute(data, context)
context = super(AddIPsecPolicyStep, self).contribute(data, context)
context['lifetime'] = {'units': data['lifetime_units'],
'value': data['lifetime_value']}
context.pop('lifetime_units')
@ -395,14 +395,14 @@ class AddIPSecPolicyStep(workflows.Step):
return context
class AddIPSecPolicy(workflows.Workflow):
class AddIPsecPolicy(workflows.Workflow):
slug = "addipsecpolicy"
name = _("Add IPSec Policy")
name = _("Add IPsec Policy")
finalize_button_name = _("Add")
success_message = _('Added IPSec Policy "%s".')
failure_message = _('Unable to add IPSec Policy "%s".')
success_message = _('Added IPsec policy "%s".')
failure_message = _('Unable to add IPsec policy "%s".')
success_url = "horizon:project:vpn:index"
default_steps = (AddIPSecPolicyStep,)
default_steps = (AddIPsecPolicyStep,)
def format_status_message(self, message):
return message % self.context.get('name')
@ -415,13 +415,13 @@ class AddIPSecPolicy(workflows.Workflow):
return False
class AddIPSecSiteConnectionAction(workflows.Action):
class AddIPsecSiteConnectionAction(workflows.Action):
name = forms.CharField(max_length=80, label=_("Name"), required=False)
description = forms.CharField(
initial="", required=False,
max_length=80, label=_("Description"))
vpnservice_id = forms.ChoiceField(
label=_("VPN Service associated with this connection"))
label=_("VPN service associated with this connection"))
local_ep_group_id = forms.ChoiceField(
required=False,
label=_("Endpoint Group for local subnet(s)"),
@ -429,9 +429,9 @@ class AddIPSecSiteConnectionAction(workflows.Action):
"connected to. Required if no subnet is specified "
"in a VPN service selected."))
ikepolicy_id = forms.ChoiceField(
label=_("IKE Policy associated with this connection"))
label=_("IKE policy associated with this connection"))
ipsecpolicy_id = forms.ChoiceField(
label=_("IPSec Policy associated with this connection"))
label=_("IPsec policy associated with this connection"))
peer_address = forms.IPField(
label=_("Peer gateway public IPv4/IPv6 Address or FQDN"),
help_text=_("Peer gateway public IPv4/IPv6 address or FQDN for "
@ -447,7 +447,7 @@ class AddIPSecSiteConnectionAction(workflows.Action):
peer_ep_group_id = forms.ChoiceField(
required=False,
label=_("Endpoint Group for remote peer CIDR(s)"),
help_text=_("Remote peer CIDR(s) connected to the new IPSec "
help_text=_("Remote peer CIDR(s) connected to the new IPsec "
"connection."))
peer_cidrs = forms.MultiIPField(
required=False,
@ -466,13 +466,13 @@ class AddIPSecSiteConnectionAction(workflows.Action):
"between the two peers of the VPN connection"))
def populate_ikepolicy_id_choices(self, request, context):
ikepolicy_id_choices = [('', _("Select IKE Policy"))]
ikepolicy_id_choices = [('', _("Select IKE policy"))]
try:
tenant_id = self.request.user.tenant_id
ikepolicies = api_vpn.ikepolicy_list(request, tenant_id=tenant_id)
except Exception:
exceptions.handle(request,
_('Unable to retrieve IKE Policies list.'))
_('Unable to retrieve IKE policies list.'))
ikepolicies = []
for p in ikepolicies:
ikepolicy_id_choices.append((p.id, p.name))
@ -480,14 +480,14 @@ class AddIPSecSiteConnectionAction(workflows.Action):
return ikepolicy_id_choices
def populate_ipsecpolicy_id_choices(self, request, context):
ipsecpolicy_id_choices = [('', _("Select IPSec Policy"))]
ipsecpolicy_id_choices = [('', _("Select IPsec Policy"))]
try:
tenant_id = self.request.user.tenant_id
ipsecpolicies = api_vpn.ipsecpolicy_list(request,
tenant_id=tenant_id)
except Exception:
exceptions.handle(request,
_('Unable to retrieve IPSec Policies list.'))
_('Unable to retrieve IPsec policies list.'))
ipsecpolicies = []
for p in ipsecpolicies:
ipsecpolicy_id_choices.append((p.id, p.name))
@ -495,13 +495,13 @@ class AddIPSecSiteConnectionAction(workflows.Action):
return ipsecpolicy_id_choices
def populate_vpnservice_id_choices(self, request, context):
vpnservice_id_choices = [('', _("Select VPN Service"))]
vpnservice_id_choices = [('', _("Select VPN service"))]
try:
tenant_id = self.request.user.tenant_id
vpnservices = api_vpn.vpnservice_list(request, tenant_id=tenant_id)
except Exception:
exceptions.handle(request,
_('Unable to retrieve VPN Services list.'))
_('Unable to retrieve VPN services list.'))
vpnservices = []
for s in vpnservices:
vpnservice_id_choices.append((s.id, s.name))
@ -539,24 +539,24 @@ class AddIPSecSiteConnectionAction(workflows.Action):
return peer_ep_group_ids
class Meta(object):
name = _("Add New IPSec Site Connection")
name = _("Add New IPsec Site Connection")
permissions = ('openstack.services.network',)
help_text = _("Create IPSec Site Connection for current "
help_text = _("Create IPsec site connection for current "
"project. Assign a name and description for the "
"IPSec Site Connection. "
"IPsec site connection. "
"All fields in this tab are required."
)
class AddIPSecSiteConnectionStep(workflows.Step):
action_class = AddIPSecSiteConnectionAction
class AddIPsecSiteConnectionStep(workflows.Step):
action_class = AddIPsecSiteConnectionAction
contributes = ("name", "description",
"vpnservice_id", "ikepolicy_id", "ipsecpolicy_id",
"peer_address", "peer_id", "peer_cidrs", "psk",
"local_ep_group_id", "peer_ep_group_id")
class AddIPSecSiteConnectionOptionalAction(workflows.Action):
class AddIPsecSiteConnectionOptionalAction(workflows.Action):
mtu = forms.IntegerField(
min_value=68,
label=_("Maximum Transmission Unit size for the connection"),
@ -580,14 +580,14 @@ class AddIPSecSiteConnectionOptionalAction(workflows.Action):
initiator = forms.ChoiceField(label=_("Initiator state"), required=False)
admin_state_up = forms.BooleanField(
label=_("Enable Admin State"),
help_text=_("The state of IPSec site connection to start in. "
"If disabled (not checked), IPSec site connection "
help_text=_("The state of IPsec site connection to start in. "
"If disabled (not checked), IPsec site connection "
"does not forward packets."),
initial=True,
required=False)
def __init__(self, request, *args, **kwargs):
super(AddIPSecSiteConnectionOptionalAction, self).__init__(
super(AddIPsecSiteConnectionOptionalAction, self).__init__(
request, *args, **kwargs)
initiator_choices = [("bi-directional", "bi-directional"),
@ -604,7 +604,7 @@ class AddIPSecSiteConnectionOptionalAction(workflows.Action):
return dpd_action_choices
def clean(self):
cleaned_data = super(AddIPSecSiteConnectionOptionalAction,
cleaned_data = super(AddIPsecSiteConnectionOptionalAction,
self).clean()
interval = cleaned_data.get('dpd_interval')
timeout = cleaned_data.get('dpd_timeout')
@ -619,18 +619,18 @@ class AddIPSecSiteConnectionOptionalAction(workflows.Action):
permissions = ('openstack.services.network',)
help_text = _("Fields in this tab are optional. "
"You can configure the detail of "
"IPSec site connection created."
"IPsec site connection created."
)
class AddIPSecSiteConnectionOptionalStep(workflows.Step):
action_class = AddIPSecSiteConnectionOptionalAction
class AddIPsecSiteConnectionOptionalStep(workflows.Step):
action_class = AddIPsecSiteConnectionOptionalAction
contributes = ("dpd_action", "dpd_interval", "dpd_timeout",
"initiator", "mtu", "admin_state_up")
def contribute(self, data, context):
context = super(
AddIPSecSiteConnectionOptionalStep, self).contribute(data, context)
AddIPsecSiteConnectionOptionalStep, self).contribute(data, context)
context['dpd'] = {'action': data['dpd_action'],
'interval': data['dpd_interval'],
'timeout': data['dpd_timeout']}
@ -646,15 +646,15 @@ class AddIPSecSiteConnectionOptionalStep(workflows.Step):
return context
class AddIPSecSiteConnection(workflows.Workflow):
class AddIPsecSiteConnection(workflows.Workflow):
slug = "addipsecsiteconnection"
name = _("Add IPSec Site Connection")
name = _("Add IPsec Site Connection")
finalize_button_name = _("Add")
success_message = _('Added IPSec Site Connection "%s".')
failure_message = _('Unable to add IPSec Site Connection "%s".')
success_message = _('Added IPsec site connection "%s".')
failure_message = _('Unable to add IPsec site connection "%s".')
success_url = "horizon:project:vpn:index"
default_steps = (AddIPSecSiteConnectionStep,
AddIPSecSiteConnectionOptionalStep)
default_steps = (AddIPsecSiteConnectionStep,
AddIPsecSiteConnectionOptionalStep)
def format_status_message(self, message):
return message % self.context.get('name')

View File

@ -226,7 +226,7 @@ class VPNaasApiTests(test.APITestCase):
self.mox.ReplayAll()
ret_val = api_vpn.ipsecpolicy_create(self.request, **form_data)
self.assertIsInstance(ret_val, api_vpn.IPSecPolicy)
self.assertIsInstance(ret_val, api_vpn.IPsecPolicy)
@test.create_stubs({neutronclient: ('list_ipsecpolicies',
'list_ipsec_site_connections')})
@ -244,7 +244,7 @@ class VPNaasApiTests(test.APITestCase):
ret_val = api_vpn.ipsecpolicy_list(self.request)
for (v, d) in zip(ret_val, ipsecpolicies['ipsecpolicies']):
self.assertIsInstance(v, api_vpn.IPSecPolicy)
self.assertIsInstance(v, api_vpn.IPsecPolicy)
self.assertTrue(v.name, d.name)
self.assertTrue(v.id)
@ -264,7 +264,7 @@ class VPNaasApiTests(test.APITestCase):
self.mox.ReplayAll()
ret_val = api_vpn.ipsecpolicy_get(self.request, ipsecpolicy.id)
self.assertIsInstance(ret_val, api_vpn.IPSecPolicy)
self.assertIsInstance(ret_val, api_vpn.IPsecPolicy)
@test.create_stubs({neutronclient: ('create_ipsec_site_connection',)})
def test_ipsecsiteconnection_create(self):
@ -294,7 +294,7 @@ class VPNaasApiTests(test.APITestCase):
ret_val = api_vpn.ipsecsiteconnection_create(
self.request, **form_data)
self.assertIsInstance(ret_val, api_vpn.IPSecSiteConnection)
self.assertIsInstance(ret_val, api_vpn.IPsecSiteConnection)
@test.create_stubs({neutronclient: ('list_ipsec_site_connections',
'list_ikepolicies',
@ -320,7 +320,7 @@ class VPNaasApiTests(test.APITestCase):
ret_val = api_vpn.ipsecsiteconnection_list(self.request)
for (v, d) in zip(ret_val,
ipsecsiteconnections['ipsec_site_connections']):
self.assertIsInstance(v, api_vpn.IPSecSiteConnection)
self.assertIsInstance(v, api_vpn.IPsecSiteConnection)
self.assertTrue(v.name, d.name)
self.assertTrue(v.id)
@ -348,4 +348,4 @@ class VPNaasApiTests(test.APITestCase):
ret_val = api_vpn.ipsecsiteconnection_get(self.request,
ipsecsiteconnection.id)
self.assertIsInstance(ret_val, api_vpn.IPSecSiteConnection)
self.assertIsInstance(ret_val, api_vpn.IPsecSiteConnection)

View File

@ -32,7 +32,7 @@ def data(TEST):
TEST.api_ipsecsiteconnections = utils.TestDataContainer()
TEST.api_endpointgroups = utils.TestDataContainer()
# 1st VPNService.
# 1st VPN service.
vpnservice_dict = {'id': '09a26949-6231-4f72-942a-0c8c0ddd4d61',
'tenant_id': '1',
'name': 'cloud_vpn1',
@ -48,7 +48,7 @@ def data(TEST):
TEST.api_vpnservices.add(vpnservice_dict)
TEST.vpnservices.add(vpn.VPNService(vpnservice_dict))
# 2nd VPNService.
# 2nd VPN service.
vpnservice_dict = {'id': '09a26949-6231-4f72-942a-0c8c0ddd4d62',
'tenant_id': '1',
'name': 'cloud_vpn2',
@ -77,7 +77,7 @@ def data(TEST):
TEST.api_endpointgroups.add(endpointgroup_dict)
TEST.endpointgroups.add(vpn.EndpointGroup(endpointgroup_dict))
# 1st IKEPolicy
# 1st IKE policy
ikepolicy_dict = {'id': 'a1f009b7-0ffa-43a7-ba19-dcabb0b4c981',
'tenant_id': '1',
'name': 'ikepolicy_1',
@ -92,7 +92,7 @@ def data(TEST):
TEST.api_ikepolicies.add(ikepolicy_dict)
TEST.ikepolicies.add(vpn.IKEPolicy(ikepolicy_dict))
# 2nd IKEPolicy
# 2nd IKE policy
ikepolicy_dict = {'id': 'a1f009b7-0ffa-43a7-ba19-dcabb0b4c982',
'tenant_id': '1',
'name': 'ikepolicy_2',
@ -107,7 +107,7 @@ def data(TEST):
TEST.api_ikepolicies.add(ikepolicy_dict)
TEST.ikepolicies.add(vpn.IKEPolicy(ikepolicy_dict))
# 1st IPSecPolicy
# 1st IPsec policy
ipsecpolicy_dict = {'id': '8376e1dd-2b1c-4346-b23c-6989e75ecdb8',
'tenant_id': '1',
'name': 'ipsecpolicy_1',
@ -120,9 +120,9 @@ def data(TEST):
'transform_protocol': 'esp',
'ipsecsiteconns': TEST.ipsecsiteconnections.list()}
TEST.api_ipsecpolicies.add(ipsecpolicy_dict)
TEST.ipsecpolicies.add(vpn.IPSecPolicy(ipsecpolicy_dict))
TEST.ipsecpolicies.add(vpn.IPsecPolicy(ipsecpolicy_dict))
# 2nd IPSecPolicy
# 2nd IPsec policy
ipsecpolicy_dict = {'id': '8376e1dd-2b1c-4346-b23c-6989e75ecdb9',
'tenant_id': '1',
'name': 'ipsecpolicy_2',
@ -135,9 +135,9 @@ def data(TEST):
'transform_protocol': 'esp',
'ipsecsiteconns': []}
TEST.api_ipsecpolicies.add(ipsecpolicy_dict)
TEST.ipsecpolicies.add(vpn.IPSecPolicy(ipsecpolicy_dict))
TEST.ipsecpolicies.add(vpn.IPsecPolicy(ipsecpolicy_dict))
# 1st IPSecSiteConnection
# 1st IPsec site connection
ipsecsiteconnection_dict = {'id': 'dd1dd3a0-f349-49be-b013-245e147763d6',
'tenant_id': '1',
'name': 'ipsec_connection_1',
@ -160,9 +160,9 @@ def data(TEST):
'status': 'Active'}
TEST.api_ipsecsiteconnections.add(ipsecsiteconnection_dict)
TEST.ipsecsiteconnections.add(
vpn.IPSecSiteConnection(ipsecsiteconnection_dict))
vpn.IPsecSiteConnection(ipsecsiteconnection_dict))
# 2nd IPSecSiteConnection
# 2nd IPsec site connection
ipsecsiteconnection_dict = {'id': 'dd1dd3a0-f349-49be-b013-245e147763d7',
'tenant_id': '1',
'name': 'ipsec_connection_2',
@ -183,4 +183,4 @@ def data(TEST):
'status': 'Active'}
TEST.api_ipsecsiteconnections.add(ipsecsiteconnection_dict)
TEST.ipsecsiteconnections.add(
vpn.IPSecSiteConnection(ipsecsiteconnection_dict))
vpn.IPsecSiteConnection(ipsecsiteconnection_dict))