def _get_baremetal_connections(self, port,<EOL>only_active_switch=False,<EOL>from_segment=False):
connections = []<EOL>is_native = False if self.trunk.is_trunk_subport(port) else True<EOL>all_link_info = port[bc.portbindings.PROFILE]['<STR_LIT>']<EOL>for link_info in all_link_info:<EOL><INDENT>intf_type, port = nexus_help.split_interface_name(<EOL>link_info['<STR_LIT>'])<EOL>switch_info = self._get_baremetal_switch_info(<EOL>link_info)<EOL>if not switch_info:<EOL><INDENT>continue<EOL><DEDENT>switch_ip = switch_info['<STR_LIT>']<EOL>if not self._switch_defined(switch_ip):<EOL><INDENT>continue<EOL><DEDENT>if (only_active_switch and<EOL>not self.is_switch_active(switch_ip)):<EOL><INDENT>continue<EOL><DEDENT>ch_grp = <NUM_LIT:0><EOL>if not from_segment:<EOL><INDENT>try:<EOL><INDENT>reserved = nxos_db.get_switch_if_host_mappings(<EOL>switch_ip,<EOL>nexus_help.format_interface_name(<EOL>intf_type, port))<EOL>if reserved[<NUM_LIT:0>].ch_grp > <NUM_LIT:0>:<EOL><INDENT>ch_grp = reserved[<NUM_LIT:0>].ch_grp<EOL>intf_type, port = nexus_help.split_interface_name(<EOL>'<STR_LIT>', ch_grp)<EOL><DEDENT><DEDENT>except excep.NexusHostMappingNotFound:<EOL><INDENT>pass<EOL><DEDENT><DEDENT>connections.append((switch_ip, intf_type, port,<EOL>is_native, ch_grp))<EOL><DEDENT>return connections<EOL>
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