'Check for changed VLAN tags. If changes, notify server and return.
The returned value is a set of port ids of the ports concerned by a
vlan tag loss.'

def check_changed_vlans(self):

    port_tags = self.int_br.get_port_tag_dict()
    changed_ports = set()
    for lvm in self.vlan_manager:
        for port in lvm.vif_ports.values():
            if ((port.port_name in port_tags) and (port_tags[port.port_name] != lvm.vlan)):
                LOG.info(_LI("Port    '%(port_name)s'    has    lost    its    vlan    tag    '%(vlan_tag)d'!"), {'port_name': port.port_name, 'vlan_tag': lvm.vlan})
                changed_ports.add(port.vif_id)
    if changed_ports:
        devices_down = self.plugin_rpc.update_device_list(self.context, [], changed_ports, self.agent_id, self.conf.host)
        failed_devices = set(devices_down.get('failed_devices_down'))
        if failed_devices:
            LOG.debug('Status    updated    failed    for    %s', failed_devices)
    return changed_ports
