[horizon] [fwaas] "Remove Rule" from a policy should be available only when rules are associated with the policy

Bug #1252996 reported by Rami Vaknin
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Dashboard (Horizon)
Fix Released
Medium
chenhaiq

Bug Description

Description
===========
Currently, when a firewall policy has no associated rules, the "Firewalls"->"Firewall Policies"->"More" button of a policy->"Remove Rule" option is available (and not in red font), when clicking on it, it's possible to click on the "Save Changes" button of the opened "Remove Rule from Policy" dialog and get the following error:

Error: Failed to remove rule from policy policy_test: 404-{u'NeutronError': {u'message': u'Firewall Rule .json could not be found.', u'type': u'FirewallRuleNotFound', u'detail': u''}}

I'd expect:
  i. The "Remove Rule" should appear in red font
 ii. The "Save Changes" in the "Remove Rule from Policy" dialog should be grayed-out
iii. This operation should not lead to error, but to warning
 iv. The error message is wrong anyway, it should be something like "No sssociated Firewall Rule could be found" instead of "Firewall Rule .json could not be found"

From the log file
=================
2013-11-20 09:39:48.467 26712 ERROR neutron.api.v2.resource [-] show failed
2013-11-20 09:39:48.467 26712 TRACE neutron.api.v2.resource Traceback (most recent call last):
2013-11-20 09:39:48.467 26712 TRACE neutron.api.v2.resource File "/usr/lib/python2.6/site-packages/neutron/api/v2/resource.py", line 84, in resource
2013-11-20 09:39:48.467 26712 TRACE neutron.api.v2.resource result = method(request=request, **args)
2013-11-20 09:39:48.467 26712 TRACE neutron.api.v2.resource File "/usr/lib/python2.6/site-packages/neutron/api/v2/base.py", line 290, in show
2013-11-20 09:39:48.467 26712 TRACE neutron.api.v2.resource parent_id=parent_id),
2013-11-20 09:39:48.467 26712 TRACE neutron.api.v2.resource File "/usr/lib/python2.6/site-packages/neutron/api/v2/base.py", line 258, in _item
2013-11-20 09:39:48.467 26712 TRACE neutron.api.v2.resource obj = obj_getter(request.context, id, **kwargs)
2013-11-20 09:39:48.467 26712 TRACE neutron.api.v2.resource File "/usr/lib/python2.6/site-packages/neutron/db/firewall/firewall_db.py", line 403, in get_firewall_rule
2013-11-20 09:39:48.467 26712 TRACE neutron.api.v2.resource fwr = self._get_firewall_rule(context, id)
2013-11-20 09:39:48.467 26712 TRACE neutron.api.v2.resource File "/usr/lib/python2.6/site-packages/neutron/db/firewall/firewall_db.py", line 111, in _get_firewall_rule
2013-11-20 09:39:48.467 26712 TRACE neutron.api.v2.resource raise firewall.FirewallRuleNotFound(firewall_rule_id=id)
2013-11-20 09:39:48.467 26712 TRACE neutron.api.v2.resource FirewallRuleNotFound: Firewall Rule .json could not be found.

Revision history for this message
Rami Vaknin (rvaknin) wrote :
Revision history for this message
Rami Vaknin (rvaknin) wrote :
Revision history for this message
Rami Vaknin (rvaknin) wrote :

My env is havana on rhel.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to horizon (master)

Fix proposed to branch: master
Review: https://review.openstack.org/60470

Changed in horizon:
assignee: nobody → chenhaiq (chenhaiq)
status: New → In Progress
Akihiro Motoki (amotoki)
Changed in horizon:
importance: Undecided → Medium
milestone: none → icehouse-2
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to horizon (master)

Reviewed: https://review.openstack.org/60470
Committed: https://git.openstack.org/cgit/openstack/horizon/commit/?id=6557ff66d75e581dba3183f93afb4a769647cf06
Submitter: Jenkins
Branch: master

commit 6557ff66d75e581dba3183f93afb4a769647cf06
Author: chenhaiq <email address hidden>
Date: Fri Dec 6 18:32:07 2013 +0800

    Set "remove rule" field to be required in dialog

    The dialog can be open from: the "Firewalls"->"Firewall Policies"
    ->"More" button of a policy->"Remove Rule"

    The "remove rule" field should be required, otherwise, user will
    hit error when no rule is select. Removed "required=False",
    because it is default to True.

    Added 'btn-danger' to the button style

    Change-Id: Ifa21419bc93818335057bb16ed2683994c6efee7
    Closes-Bug: #1252996

Changed in horizon:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in horizon:
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in horizon:
milestone: icehouse-2 → 2014.1
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.