GBP Ext-Seg: updating cidr option needs to be removed

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

Bug Description

GBP CLI for external-segment provides the attribute 'cidr' as a editable. However when we try to update it it raises exception as a "Read-only" attribute.

From deployment point of view this cidr/subnet is not something which user would be editing/updating often hence keeping it 'read-only' makes sense.

However we should remove that Option from the CLI :

[root@f3-controller ~(keystone_admin)]# gbp external-segment-update --help
usage: gbp external-segment-update [-h] [--request-format {json,xml}]
                                   [--description DESCRIPTION] [--name NAME]
                                   [--ip-version {4,6}] [--cidr CIDR]
                                   [--external-route destination=CIDR,nexthop=IP_ADDR]
                                   [--port-address-translation PORT_ADDRESS_TRANSLATION]
                                   [--shared SHARED]
                                   EXTERNAL_SEGMENT

Update External Segment's information.

positional arguments:
  EXTERNAL_SEGMENT ID or name of external_segment to update.

optional arguments:
  -h, --help show this help message and exit
  --request-format {json,xml}
                        The XML or JSON request format.
  --description DESCRIPTION
                        Description of the External Segment
  --name NAME New name of External Segment
  --ip-version {4,6} IP version, default is 4
  --cidr CIDR CIDR of External Segment, default is 172.16.0.0/12
  --external-route destination=CIDR,nexthop=IP_ADDR
                        External route (This option can be repeated).
  --port-address-translation PORT_ADDRESS_TRANSLATION
                        Perform port-based address translation, default is
                        False
  --shared SHARED Shared flag

2015-08-19 12:22:51.804 661 DEBUG routes.middleware [req-45faf5ea-91be-448b-9111-2b5f2ad30267 ] Matched PUT /grouppolicy/external_segments/d1bc7d4b-664d-434c-9fc1-4b09edf3dcbe.json __call__ /usr/lib/python2.7/site-packages/routes/middleware.py:100
2015-08-19 12:22:51.804 661 DEBUG routes.middleware [req-45faf5ea-91be-448b-9111-2b5f2ad30267 ] Route path: '/grouppolicy/external_segments/:(id).:(format)', defaults: {'action': u'update', 'controller': <wsgify at 88209424 wrapping <function resource at 0x541a2a8>>} __call__ /usr/lib/python2.7/site-packages/routes/middleware.py:102
2015-08-19 12:22:51.805 661 DEBUG routes.middleware [req-45faf5ea-91be-448b-9111-2b5f2ad30267 ] Match dict: {'action': u'update', 'controller': <wsgify at 88209424 wrapping <function resource at 0x541a2a8>>, 'id': u'd1bc7d4b-664d-434c-9fc1-4b09edf3dcbe', 'format': u'json'} __call__ /usr/lib/python2.7/site-packages/routes/middleware.py:103
2015-08-19 12:22:51.805 661 DEBUG oslo.messaging._drivers.amqp [req-45faf5ea-91be-448b-9111-2b5f2ad30267 ] UNIQUE_ID is bf94cdd5d9e2401ca62dd7f34133791c. _add_unique_id /usr/lib/python2.7/site-packages/oslo/messaging/_drivers/amqp.py:246
2015-08-19 12:22:51.807 661 DEBUG amqp [req-45faf5ea-91be-448b-9111-2b5f2ad30267 ] Closed channel #1 _do_close /usr/lib/python2.7/site-packages/amqp/channel.py:104
2015-08-19 12:22:51.808 661 DEBUG amqp [req-45faf5ea-91be-448b-9111-2b5f2ad30267 ] using channel_id: 1 __init__ /usr/lib/python2.7/site-packages/amqp/channel.py:80
2015-08-19 12:22:51.808 661 DEBUG amqp [req-45faf5ea-91be-448b-9111-2b5f2ad30267 ] Channel open _open_ok /usr/lib/python2.7/site-packages/amqp/channel.py:438
2015-08-19 12:22:51.809 661 DEBUG neutron.api.v2.base [req-45faf5ea-91be-448b-9111-2b5f2ad30267 None] Request body: {u'external_segment': {u'cidr': u'2.105.1.254/24'}} prepare_request_body /usr/lib/python2.7/site-packages/neutron/api/v2/base.py:582
2015-08-19 12:22:51.809 661 ERROR neutron.api.v2.resource [req-45faf5ea-91be-448b-9111-2b5f2ad30267 None] update failed
2015-08-19 12:22:51.809 661 TRACE neutron.api.v2.resource Traceback (most recent call last):
2015-08-19 12:22:51.809 661 TRACE neutron.api.v2.resource File "/usr/lib/python2.7/site-packages/neutron/api/v2/resource.py", line 87, in resource
2015-08-19 12:22:51.809 661 TRACE neutron.api.v2.resource result = method(request=request, **args)
2015-08-19 12:22:51.809 661 TRACE neutron.api.v2.resource File "/usr/lib/python2.7/site-packages/neutron/api/v2/base.py", line 501, in update
2015-08-19 12:22:51.809 661 TRACE neutron.api.v2.resource allow_bulk=self._allow_bulk)
2015-08-19 12:22:51.809 661 TRACE neutron.api.v2.resource File "/usr/lib/python2.7/site-packages/neutron/api/v2/base.py", line 623, in prepare_request_body
2015-08-19 12:22:51.809 661 TRACE neutron.api.v2.resource raise webob.exc.HTTPBadRequest(msg)
2015-08-19 12:22:51.809 661 TRACE neutron.api.v2.resource HTTPBadRequest: Cannot update read-only attribute cidr

Tags: gbp
Changed in group-based-policy-client:
status: New → Confirmed
importance: Undecided → Low
assignee: nobody → Sumit Naiksatam (snaiksat)
milestone: none → 1.0.0
Revision history for this message
Sumit Naiksatam (snaiksat) wrote :
Changed in group-based-policy-client:
status: Confirmed → Fix Committed
Changed in group-based-policy-client:
status: Fix Committed → Fix Released
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.