Skip to content

Commit

Permalink
Wrong port id in floatingip-show of floatingip assigned to virtual-ip…
Browse files Browse the repository at this point in the history
… port

In case of floating ip on the Virtual-ip, svc-monitor will link floating ip to
"right" interface of service VMs launched by ha-proxy service instance.

Ignore such VMI while walking the vmi_ref from floatingip object.
This is done based on the service interface type of the interface.
Right interface of the service instance will have this property value set to "right"

Change-Id: Icb8cc874da4d18c4def631566fc7e2257f2f5fe4
Closes-bug: #1482277
  • Loading branch information
bailkeri committed Aug 18, 2015
1 parent 8f086b0 commit 96e3d71
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/config/vnc_openstack/vnc_openstack/neutron_plugin_db.py
Expand Up @@ -1628,6 +1628,16 @@ def _floatingip_vnc_to_neutron(self, fip_obj):
try:
port_obj = self._virtual_machine_interface_read(
port_id=port_ref['uuid'])

# In case of floating ip on the Virtual-ip, svc-monitor will
# link floating ip to "right" interface of service VMs
# launched by ha-proxy service instance. Skip them
props = port_obj.get_virtual_machine_interface_properties()
if props:
interface_type = props.get_service_interface_type()
if interface_type == "right":
continue

port_id = port_ref['uuid']
break
except NoIdError:
Expand Down
Expand Up @@ -78,6 +78,9 @@ def test_floating_show_router_id(self):
dbi = MockDbInterface()
vmi_obj = None

def fake_virtual_machine_interface_properties():
return None

def fake_virtual_machine_read(id, fq_name=None, fields=None,
parent_id=None):
if id == 'fip_port_uuid1':
Expand All @@ -87,6 +90,8 @@ def fake_virtual_machine_read(id, fq_name=None, fields=None,
elif id == 'router_port_uuid':
net_uuid = 'match_vn_uuid'
return flexmock(uuid=id,
get_virtual_machine_interface_properties=\
fake_virtual_machine_interface_properties,
get_virtual_network_refs=\
lambda: [{'uuid': net_uuid}])

Expand Down

0 comments on commit 96e3d71

Please sign in to comment.