Ask Your Question
0

unbale to add neutron interface via API

asked 2014-05-26 09:03:23 -0500

Deeptanshu gravatar image

updated 2014-05-26 18:27:34 -0500

larsks gravatar image

We are getting the below error while adding the interface on router in neutron. Please check and suggest.

We are using the below API .

We are seeing the following error:

ERROR neutron.api.v2.resource [req-70b9a202-46c4-4807-8cb3-fd7dc69655e4 None] add_router_interface failed
TRACE neutron.api.v2.resource Traceback (most recent call last):
TRACE neutron.api.v2.resource   File "/usr/lib/python2.7/dist-packages/neutron/api/v2/resource.py", line 87, in resource
TRACE neutron.api.v2.resource     result = method(request=request, **args)
TRACE neutron.api.v2.resource   File "/usr/lib/python2.7/dist-packages/neutron/api/v2/base.py", line 194, in _handle_action
TRACE neutron.api.v2.resource     return getattr(self._plugin, name)(*arg_list, **kwargs)
TRACE neutron.api.v2.resource   File "/usr/lib/python2.7/dist-packages/neutron/db/l3_db.py", line 362, in add_router_interface
TRACE neutron.api.v2.resource     'tenant_id': subnet['tenant_id'],
TRACE neutron.api.v2.resource UnboundLocalError: local variable 'subnet' referenced before assignment
TRACE neutron.api.v2.resource
INFO neutron.wsgi [req-70b9a202-46c4-4807-8cb3-fd7dc69655e4 None] 14.140.67.230 - - [26/May/2014 18:56:45] "PUT /v2.0/routers/5d071008-7376-4bd9-8c53-e81405abb976/add_router_interface HTTP/1.1" 500 296 0.054011
edit retag flag offensive close merge delete

Comments

1

That looks like a bug in neutron. What version are you running?

larsks gravatar imagelarsks ( 2014-05-26 18:30:03 -0500 )edit

HI,

We are using Icehouse. As per the update this bug seems resolved in Icehouse.

Deeptanshu gravatar imageDeeptanshu ( 2014-05-27 02:27:50 -0500 )edit

1 answer

Sort by ยป oldest newest most voted
0

answered 2014-05-28 08:29:00 -0500

Deeptanshu gravatar image

updated 2014-05-28 08:32:28 -0500

HI ,

Can anyone answer for the solution. I have tried a lot with the given error. When i run the API through browser getting the below error.

API CODE

"port": { "status": "ACTIVE", "name": "hellorouter", "admin_state_up": true,

"network_id": "7ab1aede-c06f-4fb8-9dc4-660e14c0a7c2",

"tenant_id": "34e0ddd664044aaf89efa81d248269f9",

"device_owner": "network:router_interface",

"mac_address": "fa:16:3e:93:6c:25",

"fixed_ips":

[{

"subnet_id": "e31cec40-e3b6-4029-aaab-8088d6095456",

"ip_address": "192.168.12.1"

}],

"id": "e31cec40-e3b6-4029-aaab-8088d6095456", (What need to put here ? )

"device_id": "6aeb2231-c584-473a-ae61-bb23966ab437" ( What need to put here ? )

} }';

====================================================================

Browser Error

Array ( [NeutronError] => Request Failed: internal server error while processing your request. )

===========================================================================

Neutron logs

ERROR neutron.api.v2.resource [req-70b9a202-46c4-4807-8cb3-fd7dc69655e4 None] add_router_interface failed TRACE neutron.api.v2.resource Traceback (most recent call last): TRACE neutron.api.v2.resource File "/usr/lib/python2.7/dist-packages/neutron/api/v2/resource.py", line 87, in resource TRACE neutron.api.v2.resource result = method(request=request, *args) TRACE neutron.api.v2.resource File "/usr/lib/python2.7/dist-packages/neutron/api/v2/base.py", line 194, in _handle_action TRACE neutron.api.v2.resource return getattr(self._plugin, name)(arg_list, **kwargs) TRACE neutron.api.v2.resource File "/usr/lib/python2.7/dist-packages/neutron/db/l3_db.py", line 362, in add_router_interface TRACE neutron.api.v2.resource 'tenant_id': subnet['tenant_id'], TRACE neutron.api.v2.resource UnboundLocalError: local variable 'subnet' referenced before assignment TRACE neutron.api.v2.resource INFO neutron.wsgi [req-70b9a202-46c4-4807-8cb3-fd7dc69655e4 None] 14.140.67.230 - - [26/May/2014 18:56:45] "PUT /v2.0/routers/5d071008-7376-4bd9-8c53-e81405abb976/add_router_interface HTTP/1.1" 500 296 0.054011

edit flag offensive delete link more

Comments

Issue is resolved!!

Use the below API for adding the interface.

{ "subnet_id": "a2f1f29d-571b-4533-907f-5803ab96ead1",

}

Deeptanshu gravatar imageDeeptanshu ( 2014-05-29 21:13:50 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Get to know Ask OpenStack

Resources for moderators

Question Tools

1 follower

Stats

Asked: 2014-05-26 09:03:23 -0500

Seen: 319 times

Last updated: May 28 '14