referred/in-use L3policy deletion does not fail

Bug #1407323 reported by puppet-py
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Group Based Policy
Fix Released
Medium
Robert Kukura

Bug Description

If a L3policy(default/user-created) is referred by a L2policy, we are allowing the Delete of the L3policy, although the L2policy is still using that L3policy

Please find the steps to bug:

test@localhost:~/devstack$ gbp l2policy-create L2-vlan-A
Created a new l2_policy:
+----------------------+--------------------------------------+
| Field | Value |
+----------------------+--------------------------------------+
| description | |
| id | f7b990dc-ab1b-4a3a-a3ea-6a0a54ada2ba |
| l3_policy_id | 117b8e43-71c2-48f4-be9b-e5bb35f5af1b |
| name | L2-vlan-A |
| network_id | 2074f61b-9982-4109-b403-99c5fb3a1e0a |
| policy_target_groups | |
| shared | False |
| tenant_id | 3b4eb7e4327b4d90be39288b2e8dd163 |
+----------------------+--------------------------------------+
test@localhost:~/devstack$
test@localhost:~/devstack$
test@localhost:~/devstack$ gbp l2policy-list
+--------------------------------------+-----------+-------------+--------------------------------------+
| id | name | description | l3_policy_id |
+--------------------------------------+-----------+-------------+--------------------------------------+
| f7b990dc-ab1b-4a3a-a3ea-6a0a54ada2ba | L2-vlan-A | | 117b8e43-71c2-48f4-be9b-e5bb35f5af1b |
+--------------------------------------+-----------+-------------+--------------------------------------+
test@localhost:~/devstack$
test@localhost:~/devstack$ gbp l3policy-list
+--------------------------------------+---------+------------------------------+------------+----------------------+
| id | name | description | ip_pool | subnet_prefix_length |
+--------------------------------------+---------+------------------------------+------------+----------------------+
| 117b8e43-71c2-48f4-be9b-e5bb35f5af1b | default | Implicitly created L3 policy | 10.0.0.0/8 | 26 |
+--------------------------------------+---------+------------------------------+------------+----------------------+
test@localhost:~/devstack$
test@localhost:~/devstack$ gbp l3policy-delete 117b8e43-71c2-48f4-be9b-e5bb35f5af1b <<<<< This SHOULD NOT BE ALLOWED
Deleted l3_policy: 117b8e43-71c2-48f4-be9b-e5bb35f5af1b
test@localhost:~/devstack$
test@localhost:~/devstack$
test@localhost:~/devstack$ gbp l3policy-list

test@localhost:~/devstack$
test@localhost:~/devstack$ gbp l2policy-list
+--------------------------------------+-----------+-------------+--------------+
| id | name | description | l3_policy_id |
+--------------------------------------+-----------+-------------+--------------+
| f7b990dc-ab1b-4a3a-a3ea-6a0a54ada2ba | L2-vlan-A | | |
+--------------------------------------+-----------+-------------+--------------+
test@localhost:~/devstack$

affects: group-based-policy-client → group-based-policy
Changed in group-based-policy:
milestone: none → kilo-gbp-1
assignee: nobody → Sumit Naiksatam (snaiksat)
Changed in group-based-policy:
importance: Undecided → Medium
status: New → Confirmed
Changed in group-based-policy:
assignee: Sumit Naiksatam (snaiksat) → Robert Kukura (rkukura)
tags: added: juno-backport-potential
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to group-based-policy (master)

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

Changed in group-based-policy:
status: Confirmed → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to group-based-policy (master)

Reviewed: https://review.openstack.org/155504
Committed: https://git.openstack.org/cgit/stackforge/group-based-policy/commit/?id=8922c5ffb9f686ca56bfc1f4a6f31e5d4e5623cf
Submitter: Jenkins
Branch: master

commit 8922c5ffb9f686ca56bfc1f4a6f31e5d4e5623cf
Author: Robert Kukura <email address hidden>
Date: Wed Feb 11 17:07:00 2015 -0500

    Reject deletion of in-use L2Policy or L3Policy

    Before deleting an L2Policy, check that no PolicyTargetGroups
    reference it. Before deleting an L3Policy, ensure that no L2Policies
    reference it. Raise exceptions if they are in-use.

    Closes-bug: 1415244
    Closes-bug: 1407323

    Change-Id: Ie5d3c8a01a57a331eed46354c80ed28acad0fd04

Changed in group-based-policy:
status: In Progress → Fix Committed
Changed in group-based-policy:
status: Fix Committed → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to group-based-policy (stable/juno)

Fix proposed to branch: stable/juno
Review: https://review.openstack.org/160947

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to group-based-policy (stable/juno)

Reviewed: https://review.openstack.org/160947
Committed: https://git.openstack.org/cgit/stackforge/group-based-policy/commit/?id=cd45d0ea276cec6153f3e379ede8a34318e03ee5
Submitter: Jenkins
Branch: stable/juno

commit cd45d0ea276cec6153f3e379ede8a34318e03ee5
Author: Robert Kukura <email address hidden>
Date: Wed Feb 11 17:07:00 2015 -0500

    Reject deletion of in-use L2Policy or L3Policy

    Before deleting an L2Policy, check that no PolicyTargetGroups
    reference it. Before deleting an L3Policy, ensure that no L2Policies
    reference it. Raise exceptions if they are in-use.

    Closes-bug: 1415244
    Closes-bug: 1407323

    Change-Id: Ie5d3c8a01a57a331eed46354c80ed28acad0fd04
    (cherry picked from commit 8922c5ffb9f686ca56bfc1f4a6f31e5d4e5623cf)

tags: added: in-stable-juno
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.