commit 275efd57f59e9b974455d83fe6b483aa8683ceb7
Author: Dan Bode <email address hidden>
Date: Mon May 11 21:58:02 2015 -0700
Fix port-creation compat issue with openstack kilo
Backporting commit 4d25ef1878ce1f2d1c3a1b2d15f7de43957c11f4 from master
to R2.21.x
Closes-Bug: 1518271
===========================================================
Currently, my attempts to use the contrail driver for
basic operations with openstack kilo have not work.
Request Failed: internal server error while processing your request.
Looking in the contrail-api logs I can
see the following stacktrace: (note, this
stacktrace is from contrail 2.0, but this
issue is still present in master):
Traceback (most recent call last):
File "/usr/lib/python2.7/dist-packages/vnc_openstack/neutron_plugin_interface.py", line 392, in plugin_create_port
net_info = cfgdb.port_create(context, port['resource'])
File "/usr/lib/python2.7/dist-packages/vnc_openstack/neutron_plugin_db.py", line 3472, in port_create
port_obj = self._port_neutron_to_vnc(port_q, net_obj, CREATE)
File "/usr/lib/python2.7/dist-packages/vnc_openstack/neutron_plugin_db.py", line 1849, in _port_neutron_to_vnc
for fixed_ip in port_q.get('fixed_ips', []):
TypeError: 'NoneType' object is not iterable
Traceback (most recent call last):
File "/usr/lib/python2.7/dist-packages/bottle.py", line 856, in _handle
return route.call(**args)
File "/usr/lib/python2.7/dist-packages/bottle.py", line 1721, in wrapper
rv = callback(*a, **ka)
File "/usr/lib/python2.7/dist-packages/vnc_openstack/neutron_plugin_interface.py", line 467, in plugin_http_post_port
return self.plugin_create_port(context, port)
File "/usr/lib/python2.7/dist-packages/vnc_openstack/neutron_plugin_interface.py", line 396, in plugin_create_port
raise e
TypeError: 'NoneType' object is not iterable
the issue seems to be that in kilo version of openstack, the value
of the fixed_ip keys is None instead of not defined when there
are no fixed_ips.
The issue goes away by just performing a check to see if the
value is None, and I can create ports.
Reviewed: https:/ /review. opencontrail. org/15305 github. org/Juniper/ contrail- controller/ commit/ 275efd57f59e9b9 74455d83fe6b483 aa8683ceb7
Committed: http://
Submitter: Zuul
Branch: R2.21.x
commit 275efd57f59e9b9 74455d83fe6b483 aa8683ceb7
Author: Dan Bode <email address hidden>
Date: Mon May 11 21:58:02 2015 -0700
Fix port-creation compat issue with openstack kilo
Backporting commit 4d25ef1878ce1f2 d1c3a1b2d15f7de 43957c11f4 from master
to R2.21.x
Closes-Bug: 1518271
======= ======= ======= ======= ======= ======= ======= ======= ===
Currently, my attempts to use the contrail driver for
basic operations with openstack kilo have not work.
Specifically, I am not able to create ports.
when I perform the following actions:
neutron net-create foo 4b9e-4667- 845f-5c5ff15234 46
neutron port-create 88d35f71-
It fails with the error:
Request Failed: internal server error while processing your request.
Looking in the contrail-api logs I can
see the following stacktrace: (note, this
stacktrace is from contrail 2.0, but this
issue is still present in master):
Traceback (most recent call last): python2. 7/dist- packages/ vnc_openstack/ neutron_ plugin_ interface. py", line 392, in plugin_create_port create( context, port['resource']) python2. 7/dist- packages/ vnc_openstack/ neutron_ plugin_ db.py", line 3472, in port_create neutron_ to_vnc( port_q, net_obj, CREATE) python2. 7/dist- packages/ vnc_openstack/ neutron_ plugin_ db.py", line 1849, in _port_neutron_ to_vnc get('fixed_ ips', []):
File "/usr/lib/
net_info = cfgdb.port_
File "/usr/lib/
port_obj = self._port_
File "/usr/lib/
for fixed_ip in port_q.
TypeError: 'NoneType' object is not iterable
Traceback (most recent call last): python2. 7/dist- packages/ bottle. py", line 856, in _handle python2. 7/dist- packages/ bottle. py", line 1721, in wrapper python2. 7/dist- packages/ vnc_openstack/ neutron_ plugin_ interface. py", line 467, in plugin_ http_post_ port create_ port(context, port) python2. 7/dist- packages/ vnc_openstack/ neutron_ plugin_ interface. py", line 396, in plugin_create_port
File "/usr/lib/
return route.call(**args)
File "/usr/lib/
rv = callback(*a, **ka)
File "/usr/lib/
return self.plugin_
File "/usr/lib/
raise e
TypeError: 'NoneType' object is not iterable
the issue seems to be that in kilo version of openstack, the value
of the fixed_ip keys is None instead of not defined when there
are no fixed_ips.
The issue goes away by just performing a check to see if the
value is None, and I can create ports.
Change-Id: I1180ca8d8ced93 8920985cc542de3 5e45e1fede6