def _get_baremetal_connections(self, port,
                                   only_active_switch=False,
                                   from_segment=False):
        """Get switch ips and interfaces from baremetal transaction.

        This method is used to extract switch/interface
        information from transactions where VNIC_TYPE is
        baremetal.

        :param port: Received port transaction
        :param only_active_switch: Indicator for selecting
                     connections with switches that are active
        :param from_segment: only return interfaces from the
                   segment/transaction as opposed to
                   say port channels which are learned.
        :Returns: list of switch_ip, intf_type, port_id, is_native
        """

        connections = []

        all_link_info = port[portbindings.PROFILE]['local_link_information']
        for link_info in all_link_info:

            # Extract port info
            intf_type, port = self.split_interface_name(
                                  link_info['port_id'])

            # Determine if this switch is to be skipped
            switch_info = self._get_baremetal_switch_info(
                              link_info)
            if not switch_info:
                continue
            switch_ip = switch_info['switch_ip']

            # If not for Nexus
            if not self._switch_defined(switch_ip):
                continue

            # Requested connections for only active switches
            if (only_active_switch and
                not self.is_switch_active(switch_ip)):
                continue

            if 'is_native' in switch_info:
                is_native = switch_info['is_native']
            else:
                is_native = const.NOT_NATIVE
            if not from_segment:
                try:
                    reserved = nxos_db.get_reserved_port_binding(
                        switch_ip,
                        self.format_interface_name(
                            intf_type, port))
                    if 0 > reserved[0].channel_group:
                        intf_type, port = self.split_interface_name(
                            '', reserved[0].channel_group)
                except excep.NexusPortBindingNotFound:
                    pass

            connections.append((switch_ip, intf_type, port, is_native))

        return connections
dataset/ETHPy150Open openstack/networking-cisco/networking_cisco/plugins/ml2/drivers/cisco/nexus/mech_cisco_nexus.py/CiscoNexusMechanismDriver._get_baremetal_connections/swapped operands of `>`