Skip to content

Commit

Permalink
Merge "Fix traceback when listing floatingips with LBaaS" into R1.10
Browse files Browse the repository at this point in the history
  • Loading branch information
Zuul authored and opencontrail-ci-admin committed Feb 10, 2015
2 parents 5c157b3 + 0557406 commit e0e5abe
Showing 1 changed file with 15 additions and 4 deletions.
19 changes: 15 additions & 4 deletions src/config/vnc_openstack/vnc_openstack/neutron_plugin_db.py
Original file line number Diff line number Diff line change
Expand Up @@ -2067,10 +2067,21 @@ def _floatingip_vnc_to_neutron(self, fip_obj):
port_id = None
fixed_ip = None
router_id = None
port_obj = None
port_refs = fip_obj.get_virtual_machine_interface_refs()
if port_refs:
port_id = port_refs[0]['uuid']
for port_ref in port_refs:
try:
port_obj = self._virtual_machine_interface_read(
port_id=port_ref['uuid'])
port_id = port_ref['uuid']
break
except NoIdError:
pass

if port_obj:
internal_net_id = None

# find router_id from port
router_list = self._router_list_project(
fip_obj.get_project_refs()[0]['uuid'], detail=True)
Expand Down Expand Up @@ -2960,7 +2971,7 @@ def subnet_update(self, subnet_id, subnet_q):
exc_info = {'type': 'BadRequest',
'message': "update of gateway is not supported"}
bottle.abort(400, json.dumps(exc_info))


if 'allocation_pools' in subnet_q:
if subnet_q['allocation_pools'] != None:
Expand Down Expand Up @@ -3639,7 +3650,7 @@ def _check_for_dup_router_subnet(self, router_id,
if ip['subnet_id'] == subnet_id:
msg = (_("Router %s already has a port "
"on subnet %s") % (router_id, subnet_id))
self._raise_contrail_exception(400,
self._raise_contrail_exception(400,
exceptions.BadRequest(resource='router', msg=msg))
sub_id = ip['subnet_id']
subnet = self.subnet_read(sub_id)
Expand Down Expand Up @@ -3920,7 +3931,7 @@ def port_create(self, context, port_q):
# failure in creating the instance ip. Roll back
self._virtual_machine_interface_delete(port_id=port_id)
self._raise_contrail_exception(409,
exceptions.IpAddressGenerationFailure(net_id=net_obj.uuid))
exceptions.IpAddressGenerationFailure(net_id=net_obj.uuid))
# TODO below reads back default parent name, fix it
port_obj = self._virtual_machine_interface_read(port_id=port_id)
ret_port_q = self._port_vnc_to_neutron(port_obj)
Expand Down

0 comments on commit e0e5abe

Please sign in to comment.