'Handle the port.update.end notification event.'

@_wait_if_syncing
def port_update_end(self, context, payload):

    updated_port = dhcp.DictModel(payload['port'])
    with _net_lock(updated_port.network_id):
        if self.cache.is_port_message_stale(payload['port']):
            LOG.debug('Discarding    stale    port    update:    %s', updated_port)
            return
        network = self.cache.get_network_by_id(updated_port.network_id)
        if (not network):
            return
        LOG.info(_LI('Trigger    reload_allocations    for    port    %s'), updated_port)
        driver_action = 'reload_allocations'
        if self._is_port_on_this_agent(updated_port):
            orig = self.cache.get_port_by_id(updated_port['id'])
            orig = (orig or {'fixed_ips': []})
            old_ips = {i['ip_address'] for i in (orig['fixed_ips'] or [])}
            new_ips = {i['ip_address'] for i in updated_port['fixed_ips']}
            old_subs = {i['subnet_id'] for i in (orig['fixed_ips'] or [])}
            new_subs = {i['subnet_id'] for i in updated_port['fixed_ips']}
            if (new_subs != old_subs):
                self.schedule_resync('Agent    port    was    modified', updated_port.network_id)
                return
            elif (old_ips != new_ips):
                LOG.debug('Agent    IPs    on    network    %s    changed    from    %s    to    %s', network.id, old_ips, new_ips)
                driver_action = 'restart'
        self.cache.put_port(updated_port)
        self.call_driver(driver_action, network)
        self.dhcp_ready_ports.add(updated_port.id)
