2018-10-30 11:14:58 |
Sergey Kreys |
description |
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. |
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. |
|