From 991d8ac86c12fa45e1275851711d6feb2d9891a2 Mon Sep 17 00:00:00 2001 From: Akihiro Motoki Date: Tue, 23 Jun 2015 21:09:11 +0900 Subject: [PATCH] Remove 'shared' from Neutron Firewall table Neutron FWaaS firewall object does not support 'shared' attribute at now and 'shared' attribute is not included in API response. This commmit removes 'shared' attribute for firewall object. For more detail of the background, please see the bug report. Note that 'shared' attributes for firewall rule and policy are supported. This commit only affect the firewall object. Change-Id: I5787529395e0005ce1efee48beb6f0f688c1c736 Closes-Bug: #1465440 --- .../dashboards/project/firewalls/tables.py | 3 --- openstack_dashboard/dashboards/project/firewalls/tests.py | 2 -- .../dashboards/project/firewalls/workflows.py | 8 +------- openstack_dashboard/test/api_tests/fwaas_tests.py | 1 - openstack_dashboard/test/test_data/neutron_data.py | 2 -- 5 files changed, 1 insertion(+), 15 deletions(-) diff --git a/openstack_dashboard/dashboards/project/firewalls/tables.py b/openstack_dashboard/dashboards/project/firewalls/tables.py index 3b18b8d638..41d02f48d0 100644 --- a/openstack_dashboard/dashboards/project/firewalls/tables.py +++ b/openstack_dashboard/dashboards/project/firewalls/tables.py @@ -360,9 +360,6 @@ class FirewallsTable(tables.DataTable): status = tables.Column("status", verbose_name=_("Status"), display_choices=STATUS_DISPLAY_CHOICES) - shared = tables.Column("shared", - verbose_name=_("Shared"), - filters=(filters.yesno, filters.capfirst)) admin_state = tables.Column("admin_state", verbose_name=_("Admin State"), display_choices=ADMIN_STATE_DISPLAY_CHOICES) diff --git a/openstack_dashboard/dashboards/project/firewalls/tests.py b/openstack_dashboard/dashboards/project/firewalls/tests.py index 538e545cdc..71e2e5ffcb 100644 --- a/openstack_dashboard/dashboards/project/firewalls/tests.py +++ b/openstack_dashboard/dashboards/project/firewalls/tests.py @@ -350,7 +350,6 @@ class FirewallTests(test.TestCase): form_data = {'name': firewall.name, 'description': firewall.description, 'firewall_policy_id': firewall.firewall_policy_id, - 'shared': firewall.shared, 'admin_state_up': firewall.admin_state_up } if router_extension: @@ -403,7 +402,6 @@ class FirewallTests(test.TestCase): form_data = {'name': firewall.name, 'description': firewall.description, 'firewall_policy_id': None, - 'shared': firewall.shared, 'admin_state_up': firewall.admin_state_up } api.neutron.is_extension_supported( diff --git a/openstack_dashboard/dashboards/project/firewalls/workflows.py b/openstack_dashboard/dashboards/project/firewalls/workflows.py index 5af9d84bed..0055cc8613 100644 --- a/openstack_dashboard/dashboards/project/firewalls/workflows.py +++ b/openstack_dashboard/dashboards/project/firewalls/workflows.py @@ -278,9 +278,6 @@ class AddFirewallAction(workflows.Action): label=_("Description"), required=False) firewall_policy_id = forms.ChoiceField(label=_("Policy")) - shared = forms.BooleanField(label=_("Shared"), - initial=False, - required=False) admin_state_up = forms.ChoiceField(choices=[(True, _('UP')), (False, _('DOWN'))], label=_("Admin State")) @@ -302,9 +299,6 @@ class AddFirewallAction(workflows.Action): for p in policies: firewall_policy_id_choices.append((p.id, p.name_or_id)) self.fields['firewall_policy_id'].choices = firewall_policy_id_choices - # only admin can set 'shared' attribute to True - if not request.user.is_superuser: - self.fields['shared'].widget.attrs['disabled'] = 'disabled' class Meta(object): name = _("AddFirewall") @@ -317,7 +311,7 @@ class AddFirewallAction(workflows.Action): class AddFirewallStep(workflows.Step): action_class = AddFirewallAction contributes = ("name", "firewall_policy_id", "description", - "shared", "admin_state_up") + "admin_state_up") def contribute(self, data, context): context = super(AddFirewallStep, self).contribute(data, context) diff --git a/openstack_dashboard/test/api_tests/fwaas_tests.py b/openstack_dashboard/test/api_tests/fwaas_tests.py index 8855bd4abc..7969dddd52 100644 --- a/openstack_dashboard/test/api_tests/fwaas_tests.py +++ b/openstack_dashboard/test/api_tests/fwaas_tests.py @@ -325,7 +325,6 @@ class FwaasApiTests(test.APITestCase): form_data = {'name': firewall.name, 'description': firewall.description, 'firewall_policy_id': firewall.firewall_policy_id, - 'shared': firewall.shared, 'admin_state_up': firewall.admin_state_up } diff --git a/openstack_dashboard/test/test_data/neutron_data.py b/openstack_dashboard/test/test_data/neutron_data.py index 6e25725443..20e54083a8 100644 --- a/openstack_dashboard/test/test_data/neutron_data.py +++ b/openstack_dashboard/test/test_data/neutron_data.py @@ -986,7 +986,6 @@ def data(TEST): 'router_ids': [TEST.routers.first().id], 'description': 'firewall description', 'status': 'PENDING_CREATE', - 'shared': True, 'admin_state_up': True} TEST.api_firewalls.add(fw1_dict) @@ -1003,7 +1002,6 @@ def data(TEST): 'name': '', 'description': '', 'status': 'PENDING_CREATE', - 'shared': True, 'admin_state_up': True} TEST.api_firewalls.add(fw1_dict)