From 7d6d606d8966b3c2401cccd34422be4ca98c3a27 Mon Sep 17 00:00:00 2001 From: zhurong Date: Sat, 1 Apr 2017 17:12:04 +0800 Subject: [PATCH] Update the access_and_security url Since this bp reorganise-access-and-security, move access_and_security to separate panel, there are some places url need to change too. Closes-Bug: #1679895 Change-Id: I59560c479ad77d2452484b2138065a003451f376 (cherry picked from commit b1a907840431291007b8e3f2582486e97d86ff21) (cherry picked from commit a1de2b544700a7250dcbea4f38f7e917461b90e5) --- .../project/instances/workflows/create_instance.py | 2 +- .../key_pairs/templates/key_pairs/create.html | 2 +- .../key_pairs/templates/key_pairs/import.html | 2 +- .../templates/security_groups/create.html | 2 +- .../dashboards/project/security_groups/views.py | 2 +- .../dashboards/project/stacks/mappings.py | 4 ++-- .../test/integration_tests/regions/menus.py | 14 ++++++++++---- 7 files changed, 17 insertions(+), 11 deletions(-) diff --git a/openstack_dashboard/dashboards/project/instances/workflows/create_instance.py b/openstack_dashboard/dashboards/project/instances/workflows/create_instance.py index 1c6ceeb699..8f06fd152c 100644 --- a/openstack_dashboard/dashboards/project/instances/workflows/create_instance.py +++ b/openstack_dashboard/dashboards/project/instances/workflows/create_instance.py @@ -532,7 +532,7 @@ class SetInstanceDetails(workflows.Step): return context -KEYPAIR_IMPORT_URL = "horizon:project:access_and_security:keypairs:import" +KEYPAIR_IMPORT_URL = "horizon:project:key_pairs:import" class SetAccessControlsAction(workflows.Action): diff --git a/openstack_dashboard/dashboards/project/key_pairs/templates/key_pairs/create.html b/openstack_dashboard/dashboards/project/key_pairs/templates/key_pairs/create.html index 05ae6f15a7..26914557b6 100644 --- a/openstack_dashboard/dashboards/project/key_pairs/templates/key_pairs/create.html +++ b/openstack_dashboard/dashboards/project/key_pairs/templates/key_pairs/create.html @@ -3,6 +3,6 @@ {% block title %}{{ page_title }}{% endblock %} {% block main %} - {% include 'project/access_and_security/keypairs/_create.html' %} + {% include 'project/key_pairs/_create.html' %} {% endblock %} diff --git a/openstack_dashboard/dashboards/project/key_pairs/templates/key_pairs/import.html b/openstack_dashboard/dashboards/project/key_pairs/templates/key_pairs/import.html index a88b2d72c9..d062316c1c 100644 --- a/openstack_dashboard/dashboards/project/key_pairs/templates/key_pairs/import.html +++ b/openstack_dashboard/dashboards/project/key_pairs/templates/key_pairs/import.html @@ -3,5 +3,5 @@ {% block title %}{{ page_title }}{% endblock %} {% block main %} - {% include 'project/access_and_security/keypairs/_import.html' %} + {% include 'project/key_pairs/_import.html' %} {% endblock %} diff --git a/openstack_dashboard/dashboards/project/security_groups/templates/security_groups/create.html b/openstack_dashboard/dashboards/project/security_groups/templates/security_groups/create.html index ab43e707e1..45889a5ebd 100644 --- a/openstack_dashboard/dashboards/project/security_groups/templates/security_groups/create.html +++ b/openstack_dashboard/dashboards/project/security_groups/templates/security_groups/create.html @@ -1,5 +1,5 @@ {% extends 'base.html' %} {% block main %} - {% include 'project/access_and_security/security_groups/_create.html' %} + {% include 'project/security_groups/_create.html' %} {% endblock %} diff --git a/openstack_dashboard/dashboards/project/security_groups/views.py b/openstack_dashboard/dashboards/project/security_groups/views.py index 58ae279cac..5399356e53 100644 --- a/openstack_dashboard/dashboards/project/security_groups/views.py +++ b/openstack_dashboard/dashboards/project/security_groups/views.py @@ -85,7 +85,7 @@ class UpdateView(forms.ModalFormView): return api.network.security_group_get(self.request, sg_id) except Exception: msg = _('Unable to retrieve security group.') - url = reverse('horizon:project:access_and_security:index') + url = reverse('horizon:project:security_groups:index') exceptions.handle(self.request, msg, redirect=url) def get_context_data(self, **kwargs): diff --git a/openstack_dashboard/dashboards/project/stacks/mappings.py b/openstack_dashboard/dashboards/project/stacks/mappings.py index 8f03c4bf45..ccb74afe98 100644 --- a/openstack_dashboard/dashboards/project/stacks/mappings.py +++ b/openstack_dashboard/dashboards/project/stacks/mappings.py @@ -40,7 +40,7 @@ resource_urls = { "AWS::EC2::RouteTable": { 'link': 'horizon:project:routers:detail'}, "AWS::EC2::SecurityGroup": { - 'link': 'horizon:project:access_and_security:index'}, + 'link': 'horizon:project:security_groups:index'}, "AWS::EC2::Subnet": { 'link': 'horizon:project:networks:subnets:detail'}, "AWS::EC2::Volume": { @@ -100,7 +100,7 @@ resource_urls = { "OS::Neutron::VPNService": { 'link': 'horizon:project:vpn:vpnservicedetails'}, "OS::Nova::KeyPair": { - 'link': 'horizon:project:access_and_security:index'}, + 'link': 'horizon:project:key_pairs:index'}, "OS::Nova::Server": { 'link': 'horizon:project:instances:detail'}, "OS::Swift::Container": { diff --git a/openstack_dashboard/test/integration_tests/regions/menus.py b/openstack_dashboard/test/integration_tests/regions/menus.py index 470bd17f4a..7b500f4096 100644 --- a/openstack_dashboard/test/integration_tests/regions/menus.py +++ b/openstack_dashboard/test/integration_tests/regions/menus.py @@ -17,8 +17,10 @@ from openstack_dashboard.test.integration_tests.regions import baseregion class NavigationAccordionRegion(baseregion.BaseRegion): """Navigation menu located in the left.""" - _project_access_security_locator = ( - by.By.CSS_SELECTOR, 'a[href*="/project/access_and_security/"]') + _project_security_groups_locator = ( + by.By.CSS_SELECTOR, 'a[href*="/project/security_groups/"]') + _project_key_pairs_locator = ( + by.By.CSS_SELECTOR, 'a[href*="/project/key_pairs/"]') _settings_change_password_locator = ( by.By.CSS_SELECTOR, 'a[href*="/settings/password//"]') _project_bar_locator = (by.By.XPATH, @@ -74,8 +76,12 @@ class NavigationAccordionRegion(baseregion.BaseRegion): return None @property - def access_security(self): - return self._get_element(*self._project_access_security_locator) + def security_groups(self): + return self._get_element(*self._project_security_groups_locator) + + @property + def key_pairs(self): + return self._get_element(*self._project_key_pairs_locator) @property def change_password(self):