NVP FWaaS occurs error when removing a rule which is shared by two firewalls

Bug #1322105 reported by Bo Lin
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
neutron
Fix Released
Undecided
Bo Lin

Bug Description

Bugs reproduce process:
1. create a firewall rule and attache it to a firewall policy
2. create two firewalls with the firewall policy attached alternatively on two routers
3. remove the firewall rule from the firewall policy
it would occur the following error:

 Traceback (most recent call last):
  File "/home/stack/neutron/neutron/api/v2/resource.py", line 87, in resource
    result = method(request=request, **args)
  File "/home/stack/neutron/neutron/api/v2/base.py", line 201, in _handle_action
    return getattr(self._plugin, name)(*arg_list, **kwargs)
  File "/home/stack/neutron/neutron/plugins/vmware/plugins/service.py", line 1077, in remove_rule
    context, fwr['id'], edge_id)
  File "/home/stack/neutron/neutron/plugins/vmware/vshield/edge_firewall_driver.py", line 270, in delete_firewall_rule
    vcns_rule_id = rule_map.rule_vseid
AttributeError: 'NoneType' object has no attribute 'rule_vseid'
2014-05-22 16:21:22,244 INFO [neutron.plugins.vmware.vshield.tasks.tasks] TaskManager terminated
}}}

Traceback (most recent call last):
  File "/home/stack/neutron/neutron/tests/unit/vmware/vshield/test_fwaas_plugin.py", line 650, in test_remove_rule_with_firewalls
    expected_body=attrs)
  File "/home/stack/neutron/neutron/tests/unit/db/firewall/test_db_firewall.py", line 295, in _rule_action
    self.assertEqual(res.status_int, expected_code)
  File "/home/stack/neutron/.venv/local/lib/python2.7/site-packages/testtools/testcase.py", line 322, in assertEqual
    self.assertThat(observed, matcher, message)
  File "/home/stack/neutron/.venv/local/lib/python2.7/site-packages/testtools/testcase.py", line 412, in assertThat
    raise MismatchError(matchee, matcher, mismatch, verbose)
MismatchError: 500 != 200

It is because when deleting the corresponding vcns_edge_firewallrule_binding entry, it query based on id instead of (edge_id, id) which leads to deleting the other rule_binding entry.

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

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

Changed in neutron:
assignee: nobody → berlin (linb)
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to neutron (master)

Reviewed: https://review.openstack.org/94801
Committed: https://git.openstack.org/cgit/openstack/neutron/commit/?id=c0c3c8361771091c1ef1d4906c2552f9d92e7715
Submitter: Jenkins
Branch: master

commit c0c3c8361771091c1ef1d4906c2552f9d92e7715
Author: berlin <email address hidden>
Date: Thu May 22 16:44:17 2014 +0800

    Fix NVP FWaaS occurs error when deleting a shared rule

    It is due to the lack of edge_id query index when deleting the
    vcns_edge_firewallrule_binding entry, which leads to deleting
    rule binding entrys on both edges.
    Closes-Bug: #1322105

    Change-Id: I1d15a06bd2a6c42f29c8258d4b9344c8e9338638

Changed in neutron:
status: In Progress → Fix Committed
Changed in neutron:
milestone: none → juno-2
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in neutron:
milestone: juno-2 → 2014.2
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.