Update of L2P's L3P cannot be done by name

Bug #1416122 reported by puppet-py
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Group Based Policy Client
Confirmed
Low
Sumit Naiksatam

Bug Description

User fails to update the l3policy attribute in the case of an in-use L2Policy Object

Steps to create:
------------------------
1. Create a L2policy object either using a default L3Pol, or create a new L3Pol and associate it to the L2Policy it is created
2. Create a PTG using the above L2Policy
3. Create a new L3Policy
4. Try updating the l3policy attribute(referring to the Step-3 L3Policy) of the L2Policy Object

test@localhost:~/devstack$ gbp l3policy-list
+--------------------------------------+---------+------------------------------+-------------+----------------------+
| id | name | description | ip_pool | subnet_prefix_length |
+--------------------------------------+---------+------------------------------+-------------+----------------------+
| 156d0997-8ff0-479f-a230-5d5d2f66415a | default | Implicitly created L3 policy | 10.0.0.0/8 | 26 |
| b713467e-a54d-41dc-b669-556146863129 | A | | 20.0.0.0/16 | 24 |
+--------------------------------------+---------+------------------------------+-------------+----------------------+
test@localhost:~/devstack$
test@localhost:~/devstack$ gbp l2policy-list
+--------------------------------------+----------+------------------------------+--------------------------------------+
| id | name | description | l3_policy_id |
+--------------------------------------+----------+------------------------------+--------------------------------------+
| 526ba7f3-7bfa-4eb5-adb7-b0c36449797a | client-2 | Implicitly created L2 policy | 156d0997-8ff0-479f-a230-5d5d2f66415a |
| dda4e553-32a3-4aa2-a4d9-e4449dfd2430 | web | Implicitly created L2 policy | 156d0997-8ff0-479f-a230-5d5d2f66415a |
| f5f47beb-5a7e-40b7-a06c-c5b1a1cffcb4 | client-1 | Implicitly created L2 policy | 156d0997-8ff0-479f-a230-5d5d2f66415a |
+--------------------------------------+----------+------------------------------+--------------------------------------+
test@localhost:~/devstack$

test@localhost:~/devstack$ gbp l2policy-update client-2 --l3-policy A
Bad Request (HTTP 400) (Request-ID: req-427cc289-b322-43da-b9a0-3b80c38f5900)
test@localhost:~/devstack$

2015-01-29 12:42:48.852 19570 DEBUG routes.middleware [req-427cc289-b322-43da-b9a0-3b80c38f5900 ] Match dict: {'action': u'update', 'controller': <wsgify at 139905029822416 wrapping <function resource at 0x7f3e2d9c9b18>>, 'id': u'526ba7f3-7bfa-4eb5-adb7-b0c36449797a', 'format': u'json'} __call__ /usr/local/lib/python2.7/dist-packages/routes/middleware.py:103
2015-01-29 12:42:48.853 19570 DEBUG neutron.api.v2.base [req-427cc289-b322-43da-b9a0-3b80c38f5900 None] Request body: {u'l2_policy': {u'l3_policy': u'A'}} prepare_request_body /opt/stack/neutron/neutron/api/v2/base.py:582
2015-01-29 12:42:48.853 19570 ERROR neutron.api.v2.resource [req-427cc289-b322-43da-b9a0-3b80c38f5900 None] update failed
2015-01-29 12:42:48.853 19570 TRACE neutron.api.v2.resource Traceback (most recent call last):
2015-01-29 12:42:48.853 19570 TRACE neutron.api.v2.resource File "/opt/stack/neutron/neutron/api/v2/resource.py", line 87, in resource
2015-01-29 12:42:48.853 19570 TRACE neutron.api.v2.resource result = method(request=request, **args)
2015-01-29 12:42:48.853 19570 TRACE neutron.api.v2.resource File "/opt/stack/neutron/neutron/api/v2/base.py", line 501, in update
2015-01-29 12:42:48.853 19570 TRACE neutron.api.v2.resource allow_bulk=self._allow_bulk)
2015-01-29 12:42:48.853 19570 TRACE neutron.api.v2.resource File "/opt/stack/neutron/neutron/api/v2/base.py", line 603, in prepare_request_body
2015-01-29 12:42:48.853 19570 TRACE neutron.api.v2.resource Controller._verify_attributes(res_dict, attr_info)
2015-01-29 12:42:48.853 19570 TRACE neutron.api.v2.resource File "/opt/stack/neutron/neutron/api/v2/base.py", line 650, in _verify_attributes
2015-01-29 12:42:48.853 19570 TRACE neutron.api.v2.resource raise webob.exc.HTTPBadRequest(msg)
2015-01-29 12:42:48.853 19570 TRACE neutron.api.v2.resource HTTPBadRequest: Unrecognized attribute(s) 'l3_policy'

Revision history for this message
Sumit Naiksatam (snaiksat) wrote :

The update can be performed by providing the UUID of the l3policy and using the argument:

--l3-policy-id

The update cannot be performed by providing the name of the l3policy.

affects: group-based-policy → group-based-policy-client
Changed in group-based-policy-client:
status: New → Confirmed
importance: Undecided → Low
assignee: nobody → Sumit Naiksatam (snaiksat)
milestone: none → kilo-gbp-1
summary: - l3policy update on in-use l2policy fails
+ Update of L2P's L3P cannot be done by name
Changed in group-based-policy-client:
milestone: 0.10.0 → next
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.