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'
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.