config: unable to edit perms2 via config-editor from UI

Bug #1730024 reported by Senthilnathan Murugappan
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Juniper Openstack
Status tracked in Trunk
R3.2
Fix Committed
Undecided
Suresh Vinapamula
R4.0
Fix Committed
Undecided
Suresh Vinapamula
R4.1
Fix Committed
Undecided
Suresh Vinapamula
Trunk
Fix Committed
Undecided
Suresh Vinapamula

Bug Description

Was trying to set global_access for an object thru config-editor of ContrailUI and observe the below error from contrail-api server.

 /usr/lib/python2.7/dist-packages/vnc_cfg_api_server/vnc_cfg_api_server.py in stateful_update()
 3402 db_obj_dict['id_perms'])
 3403 elif req_obj_dict:
 3404 (ok, result) = db_conn.dbe_update(obj_type, obj_uuid, req_obj_dict)
 3405 # Update quota counter
 3406 if resource_type == 'project' and 'quota' in req_obj_dict:
ok = True
result = ''
db_conn = <vnc_cfg_api_server.vnc_db.VncDbClient object>
db_conn.dbe_update = <bound method VncDbClient.wrapper2 of <vnc_cfg_api_server.vnc_db.VncDbClient object>>
obj_type = 'policy_management'
obj_uuid = 'd81d90a0-4cba-42f9-9e03-06b514419eb7'
req_obj_dict = {'perms2': {'global_access': 5, 'owner': 'cloud-admin', 'owner_access': 7}, 'uuid': 'd81d90a0-4cba-42f9-9e03-06b514419eb7'}

 /usr/lib/python2.7/dist-packages/vnc_cfg_api_server/vnc_db.py in wrapper2(self=<vnc_cfg_api_server.vnc_db.VncDbClient object>, obj_type='policy_management', obj_id='d81d90a0-4cba-42f9-9e03-06b514419eb7',
 obj_dict={'perms2': {'global_access': 5, 'owner': 'cloud-admin', 'owner_access': 7}, 'uuid': 'd81d90a0-4cba-42f9-9e03-06b514419eb7'})
 1156 obj_id, obj_dict)
 1157 try:
 1158 ret = func(self, obj_type, obj_id, obj_dict)
 1159 trace_msg([trace], 'DBRequestTraceBuf',
 1160 self._sandesh)
ret undefined
func = <function wrapper2>
self = <vnc_cfg_api_server.vnc_db.VncDbClient object>
obj_type = 'policy_management'
obj_id = 'd81d90a0-4cba-42f9-9e03-06b514419eb7'
obj_dict = {'perms2': {'global_access': 5, 'owner': 'cloud-admin', 'owner_access': 7}, 'uuid': 'd81d90a0-4cba-42f9-9e03-06b514419eb7'}

 /usr/lib/python2.7/dist-packages/vnc_cfg_api_server/vnc_db.py in wrapper2(self=<vnc_cfg_api_server.vnc_db.VncDbClient object>, obj_type='policy_management', obj_id='d81d90a0-4cba-42f9-9e03-06b514419eb7',
 obj_dict={'perms2': {'global_access': 5, 'owner': 'cloud-admin', 'owner_access': 7}, 'uuid': 'd81d90a0-4cba-42f9-9e03-06b514419eb7'})
 1190 return (ok, result)
 1191
 1192 share_perms = new_perms2['share']
 1193 global_access = new_perms2['global_access']
 1194
share_perms undefined
new_perms2 = {'global_access': 5, 'owner': 'cloud-admin', 'owner_access': 7}
<type 'exceptions.KeyError'>: 'share'
    __class__ = <type 'exceptions.KeyError'>
    __delattr__ = <method-wrapper '__delattr__' of exceptions.KeyError object>
    __dict__ = {}
    __doc__ = 'Mapping key not found.'
    __format__ = <built-in method __format__ of exceptions.KeyError object>
    __getattribute__ = <method-wrapper '__getattribute__' of exceptions.KeyError object>
    __getitem__ = <method-wrapper '__getitem__' of exceptions.KeyError object>
    __getslice__ = <method-wrapper '__getslice__' of exceptions.KeyError object>
    __hash__ = <method-wrapper '__hash__' of exceptions.KeyError object>
    __init__ = <method-wrapper '__init__' of exceptions.KeyError object>
    __new__ = <built-in method __new__ of type object>
    __reduce__ = <built-in method __reduce__ of exceptions.KeyError object>
    __reduce_ex__ = <built-in method __reduce_ex__ of exceptions.KeyError object>
    __repr__ = <method-wrapper '__repr__' of exceptions.KeyError object>
    __setattr__ = <method-wrapper '__setattr__' of exceptions.KeyError object>
    __setstate__ = <built-in method __setstate__ of exceptions.KeyError object>
    __sizeof__ = <built-in method __sizeof__ of exceptions.KeyError object>
    __str__ = <method-wrapper '__str__' of exceptions.KeyError object>
    __subclasshook__ = <built-in method __subclasshook__ of type object>
    __unicode__ = <built-in method __unicode__ of exceptions.KeyError object>
    args = ('share',)
    message = 'share'

The above is a description of an error in a Python program. Here is
the original traceback:

Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/vnc_cfg_api_server/vnc_cfg_api_server.py", line 3431, in _put_common
    ok, result = stateful_update()
  File "/usr/lib/python2.7/dist-packages/vnc_cfg_api_server/vnc_cfg_api_server.py", line 3404, in stateful_update
    (ok, result) = db_conn.dbe_update(obj_type, obj_uuid, req_obj_dict)
  File "/usr/lib/python2.7/dist-packages/vnc_cfg_api_server/vnc_db.py", line 1158, in wrapper2
    ret = func(self, obj_type, obj_id, obj_dict)
  File "/usr/lib/python2.7/dist-packages/vnc_cfg_api_server/vnc_db.py", line 1192, in wrapper2
    share_perms = new_perms2['share']
KeyError: 'share'

Revision history for this message
OpenContrail Admin (ci-admin-f) wrote : [Review update] R3.2

Review in progress for https://review.opencontrail.org/37420
Submitter: Suresh Vinapamula (<email address hidden>)

Revision history for this message
OpenContrail Admin (ci-admin-f) wrote : [Review update] R4.1

Review in progress for https://review.opencontrail.org/37480
Submitter: Suresh Vinapamula (<email address hidden>)

Revision history for this message
OpenContrail Admin (ci-admin-f) wrote : [Review update] master

Review in progress for https://review.opencontrail.org/37481
Submitter: Suresh Vinapamula (<email address hidden>)

Revision history for this message
OpenContrail Admin (ci-admin-f) wrote : A change has been merged

Reviewed: https://review.opencontrail.org/37420
Committed: http://github.com/Juniper/contrail-controller/commit/15b01a2832711355ad4dbd9db116a919979f9c70
Submitter: Zuul (<email address hidden>)
Branch: R3.2

commit 15b01a2832711355ad4dbd9db116a919979f9c70
Author: Suresh Venkata <email address hidden>
Date: Fri Nov 10 16:31:27 2017 -0800

rbac fixes

Description:
1731055
Exceptions on CUD operations because of RBAC permissions
are not handled correctly in VNC openstack.

1730024
Perms2 is a complex property. PUT operation when issued by user
may carry partial attributes of that object. So direct dereferencing
is incorrect.
If that attribute is not present, existing attribute stays.
If that attribue needs to be deleted, it has to be present.

Change-Id: I4b3abdd24c57e7da49d728f2073ed9c2a3828cb0
Closes-Bug: #1731055
Closes-Bug: #1730024

Revision history for this message
OpenContrail Admin (ci-admin-f) wrote : [Review update] R4.1

Review in progress for https://review.opencontrail.org/37480
Submitter: Suresh Vinapamula (<email address hidden>)

Revision history for this message
OpenContrail Admin (ci-admin-f) wrote : A change has been merged

Reviewed: https://review.opencontrail.org/37480
Committed: http://github.com/Juniper/contrail-controller/commit/debdfb6cf6d3fad656d982dd14f2413622289dfd
Submitter: Zuul (<email address hidden>)
Branch: R4.1

commit debdfb6cf6d3fad656d982dd14f2413622289dfd
Author: Suresh Venkata <email address hidden>
Date: Wed Nov 15 14:05:24 2017 -0800

Description:
1731055
Exceptions on CUD operations because of RBAC permissions
are not handled correctly in VNC openstack.

1730024
Perms2 is a complex property. PUT operation when issued by user
may carry partial attributes of that object. So direct dereferencing
is incorrect.
If that attribute is not present, existing attribute stays.
If that attribue needs to be deleted, it has to be present.

Change-Id: I4b3abdd24c57e7da49d728f2073ed9c2a3828cb0
Closes-Bug: #1731055
Closes-Bug: #1730024

Revision history for this message
OpenContrail Admin (ci-admin-f) wrote : [Review update] master

Review in progress for https://review.opencontrail.org/37481
Submitter: Suresh Vinapamula (<email address hidden>)

Revision history for this message
OpenContrail Admin (ci-admin-f) wrote : A change has been merged

Reviewed: https://review.opencontrail.org/37481
Committed: http://github.com/Juniper/contrail-controller/commit/38c4f78cf46d088d0bf5b1443aaba6d1b7381d29
Submitter: Zuul (<email address hidden>)
Branch: master

commit 38c4f78cf46d088d0bf5b1443aaba6d1b7381d29
Author: Suresh Venkata <email address hidden>
Date: Wed Nov 15 14:05:24 2017 -0800

Description:
1731055
Exceptions on CUD operations because of RBAC permissions
are not handled correctly in VNC openstack.

1730024
Perms2 is a complex property. PUT operation when issued by user
may carry partial attributes of that object. So direct dereferencing
is incorrect.
If that attribute is not present, existing attribute stays.
If that attribue needs to be deleted, it has to be present.

Change-Id: I4b3abdd24c57e7da49d728f2073ed9c2a3828cb0
Closes-Bug: #1731055
Closes-Bug: #1730024
(cherry picked from commit debdfb6cf6d3fad656d982dd14f2413622289dfd)

Revision history for this message
OpenContrail Admin (ci-admin-f) wrote : [Review update] R4.0

Review in progress for https://review.opencontrail.org/38647
Submitter: Suresh Vinapamula (<email address hidden>)

Revision history for this message
OpenContrail Admin (ci-admin-f) wrote : A change has been merged

Reviewed: https://review.opencontrail.org/38647
Committed: http://github.com/Juniper/contrail-controller/commit/a4dadb1d3aa054de997c04d3c0beb707beb89574
Submitter: Zuul (<email address hidden>)
Branch: R4.0

commit a4dadb1d3aa054de997c04d3c0beb707beb89574
Author: Suresh Venkata <email address hidden>
Date: Wed Nov 15 14:05:24 2017 -0800

Description:
1731055
Exceptions on CUD operations because of RBAC permissions
are not handled correctly in VNC openstack.

1730024
Perms2 is a complex property. PUT operation when issued by user
may carry partial attributes of that object. So direct dereferencing
is incorrect.
If that attribute is not present, existing attribute stays.
If that attribue needs to be deleted, it has to be present.

Change-Id: I4b3abdd24c57e7da49d728f2073ed9c2a3828cb0
Closes-Bug: #1731055
Closes-Bug: #1730024
(cherry picked from commit debdfb6cf6d3fad656d982dd14f2413622289dfd)

Jim Reilly (jpreilly)
information type: Proprietary → Private
Jim Reilly (jpreilly)
information type: Private → Public
tags: added: att-aic-contrail
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.