'Create floating agent gw port for DVR.
Floating IP Agent gateway port will be created when a
floatingIP association happens.'

@registry.receives(resources.FLOATING_IP, [events.AFTER_UPDATE])
def _create_dvr_floating_gw_port(self, resource, event, trigger, context, router_id, fixed_port_id, floating_ip_id, floating_network_id, fixed_ip_address, **kwargs):

    associate_fip = (fixed_port_id and floating_ip_id)
    if (associate_fip and router_id):
        admin_ctx = context.elevated()
        router_dict = self.get_router(admin_ctx, router_id)
        if router_dict.get('distributed'):
            hostid = self._get_dvr_service_port_hostid(context, fixed_port_id)
            if hostid:
                fip_agent_port = self.create_fip_agent_gw_port_if_not_exists(admin_ctx, floating_network_id, hostid)
                LOG.debug('FIP    Agent    gateway    port:    %s', fip_agent_port)
            else:
                port = self._core_plugin.get_port(admin_ctx, fixed_port_id)
                allowed_device_owners = n_utils.get_dvr_allowed_address_pair_device_owners()
                if ((port['device_owner'] == '') or (port['device_owner'] in allowed_device_owners)):
                    addr_pair_active_service_port_list = self._get_ports_for_allowed_address_pair_ip(admin_ctx, port['network_id'], fixed_ip_address)
                    if (not addr_pair_active_service_port_list):
                        return
                    self._inherit_service_port_and_arp_update(context, addr_pair_active_service_port_list[0], port)
