Backporting kilo port-creation compat fix to stable

Bug #1518271 reported by Martin Millnert
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Juniper Openstack
New
Undecided
Unassigned
R2.20
Fix Committed
Undecided
Unassigned
R2.21.x
Fix Committed
Undecided
Unassigned

Bug Description

Requesting that commit 4d25ef1878ce in contrail-controller/master should be backported to the current stable branch, R2.21.x.

The fix is required for kilo compatibility and not present in R2.21.x [1] nor R2.22-dev [2].

[1] https://github.com/Juniper/contrail-controller/blob/R2.21.x/src/config/vnc_openstack/vnc_openstack/neutron_plugin_db.py#L1833
[2] https://github.com/Juniper/contrail-controller/blob/R2.22-dev/src/config/vnc_openstack/vnc_openstack/neutron_plugin_db.py#L1798

Tags: neutron
information type: Proprietary → Public
Revision history for this message
OpenContrail Admin (ci-admin-f) wrote : [Review update] R2.21.x

Review in progress for https://review.opencontrail.org/15305
Submitter: Martin Millnert (<email address hidden>)

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

Review in progress for https://review.opencontrail.org/15885
Submitter: Sachin Bansal (<email address hidden>)

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

Reviewed: https://review.opencontrail.org/15885
Committed: http://github.org/Juniper/contrail-controller/commit/1141a8678ce7e67b4512973a2cfac5b0db749f4d
Submitter: Zuul
Branch: R2.20

commit 1141a8678ce7e67b4512973a2cfac5b0db749f4d
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.

Specifically, I am not able to create ports.

when I perform the following actions:

neutron net-create foo
neutron port-create 88d35f71-4b9e-4667-845f-5c5ff1523446

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):
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.

Change-Id: I1180ca8d8ced938920985cc542de35e45e1fede6

Revision history for this message
Martin Millnert (r-martin-5) wrote :

I no longer have any interest of merging this with R2.21.x, btw. What's the proper course of action?

Revision history for this message
OpenContrail Admin (ci-admin-f) wrote :

Reviewed: https://review.opencontrail.org/15305
Committed: http://github.org/Juniper/contrail-controller/commit/275efd57f59e9b974455d83fe6b483aa8683ceb7
Submitter: Zuul
Branch: R2.21.x

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.

Specifically, I am not able to create ports.

when I perform the following actions:

neutron net-create foo
neutron port-create 88d35f71-4b9e-4667-845f-5c5ff1523446

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):
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.

Change-Id: I1180ca8d8ced938920985cc542de35e45e1fede6

Nischal Sheth (nsheth)
tags: added: neutron
removed: contrail-control
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.