Contrail VNC ifmap can not delete objects if project name contains spaces

Bug #1800636 reported by Sergey Kreys
14
This bug affects 3 people
Affects Status Importance Assigned to Milestone
Juniper Openstack
Status tracked in Trunk
R3.2
Fix Committed
Medium
Sergey Kreys
Trunk
In Progress
Medium
Sergey Kreys

Bug Description

Contrail version: R3.2

Internal python vnc_ifmap can't handle white spaces in openstack project name.

Impact: no object can be deleted from ifmap in such projects.

For example, if we have project with name "Test project with spaces", we would get the following on object deletion:

Traceback (most recent call last):
File "/usr/lib/python2.7/dist-packages/vnc_cfg_api_server/vnc_db.py", line 331, in _dbe_subscribe_callback
self._dbe_delete_notification(oper_info)
File "/usr/lib/python2.7/dist-packages/vnc_cfg_api_server/vnc_db.py", line 440, in _dbe_delete_notification
(ok, ifmap_result) = self._ifmap_db.object_delete(obj_info)
File "/usr/lib/python2.7/dist-packages/vnc_cfg_api_server/vnc_ifmap.py", line 724, in object_delete
VncIfmapServer.delete(obj_ids['imid'])
File "/usr/lib/python2.7/dist-packages/vnc_cfg_api_server/vnc_ifmap.py", line 335, in delete
cls.delete(id_name, cls.get_links(id_name).keys())
File "/usr/lib/python2.7/dist-packages/vnc_cfg_api_server/vnc_ifmap.py", line 321, in delete
if not cls._graph[other_name]['links']:
KeyError: 'contrail:virtual-machine-interface:default-domain:Test'

Affected code is in vnc_ifmap.py in delete() function:
                    other_name = link_key.split()[1]
                    <...>
                    if not cls._graph[other_name]['links']:
                        del cls._graph[other_name]
In our case link_key.split()[1] will get just a part of full object name before the first space, and hence an attempt to access it in _graph will fail with KeyError.

Sergey Kreys (skreys)
information type: Proprietary → Public
Changed in juniperopenstack:
assignee: nobody → Sergey Kreys (skreys)
status: New → In Progress
description: updated
Jeba Paulaiyan (jebap)
no longer affects: juniperopenstack/r5.0
Revision history for this message
OpenContrail Admin (ci-admin-f) wrote : [Review update] R3.2

Review in progress for https://review.opencontrail.org/47368
Submitter: Sergey Kreys (<email address hidden>)

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

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

commit ef9644f129d8a7878ba6988b27dbc5c20ed3b59c
Author: Sergey Kreys <email address hidden>
Date: Tue Oct 30 19:29:25 2018 +0300

vnc_ifmap: handle spaces in project name properly

Change-Id: Ifda7f209a3e0289749ddd6ca617d22f95d3bb069
Closes-Bug: #1800636

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.