def _supported_baremetal_transaction(self, context):
        """Verify transaction is complete and for us."""

        port = context.current

        if not self._is_baremetal(port):
            return False

        if port not in portbindings.PROFILE:
            return False

        profile = port[portbindings.PROFILE]

        if 'local_link_information' not in profile:
            return False

        all_link_info = profile['local_link_information']

        selected = False
        for link_info in all_link_info:

            if 'port_id' not in link_info:
                return False

            switch_info = self._get_baremetal_switch_info(
                              link_info)
            if 'switch_ip' in switch_info:
                switch_ip = switch_info['switch_ip']
            else:
                return False

            if self._switch_defined(switch_ip):
                selected = True
            else:
                LOG.warning(_LW("Skip switch %s.  Not configured "
                          "in ini file") % switch_ip)

        if not selected:
            return False

        selected = False
        for segment in context.segments_to_bind:

            # if valid 'vlan' type and vlan_id
            if (segment[api.NETWORK_TYPE] == p_const.TYPE_VLAN and
                segment[api.SEGMENTATION_ID]):
                context.set_binding(segment[api.ID],
                    portbindings.VIF_TYPE_OTHER,
                    {},
                    status=n_const.PORT_STATUS_ACTIVE)
                selected = True
                LOG.debug("Baremetal binding selected: segment ID %(id)s, "
                          "segment %(seg)s, phys net %(physnet)s, and "
                          "network type %(nettype)s with %(count)d "
                          "link_info",
                          {'id': segment[api.ID],
                           'seg': segment[api.SEGMENTATION_ID],
                           'physnet': segment[api.PHYSICAL_NETWORK],
                           'nettype': segment[api.NETWORK_TYPE],
                           'count': len(all_link_info)})
                break

        return selected
dataset/ETHPy150Open openstack/networking-cisco/networking_cisco/plugins/ml2/drivers/cisco/nexus/mech_cisco_nexus.py/CiscoNexusMechanismDriver._supported_baremetal_transaction/swapped operands of `not in`