def _init_baremetal_trunk_interfaces(self, port_seg, segment):
<EOL>list_to_init = []<EOL>inactive_switch = []<EOL>connections = self._get_baremetal_connections(<EOL>port_seg, False, True)<EOL>for switch_ip, intf_type, port, is_native, _ in connections:<EOL><INDENT>try:<EOL><INDENT>nxos_db.get_switch_if_host_mappings(<EOL>switch_ip,<EOL>nexus_help.format_interface_name(intf_type, port))<EOL><DEDENT>except excep.NexusHostMappingNotFound:<EOL><INDENT>if self.is_switch_active(switch_ip):<EOL><INDENT>list_to_init.append(<EOL>(switch_ip, intf_type, port, is_native, <NUM_LIT:0>))<EOL><DEDENT>else:<EOL><INDENT>inactive_switch.append(<EOL>(switch_ip, intf_type, port, is_native, <NUM_LIT:0>))<EOL><DEDENT><DEDENT><DEDENT>self.driver.initialize_baremetal_switch_interfaces(list_to_init)<EOL>host_id = port_seg.get('<STR_LIT>')<EOL>if host_id is None:<EOL><INDENT>host_id = const.RESERVED_PORT_HOST_ID<EOL><DEDENT>list_to_init += inactive_switch<EOL>for switch_ip, intf_type, port, is_native, ch_grp in list_to_init:<EOL><INDENT>nxos_db.add_host_mapping(<EOL>host_id,<EOL>switch_ip,<EOL>nexus_help.format_interface_name(intf_type, port),<EOL>ch_grp, False)<EOL><DEDENT>
Initialize baremetal switch interfaces and DB entry.

        With baremetal transactions, the interfaces are not
        known during initialization so they must be initialized
        when the transactions are received.
        * Reserved switch entries are added if needed.
        * Reserved port entries are added.
        * Determine if port channel is configured on the
          interface and store it so we know to create a port-channel
          binding instead of that defined in the transaction.
          In this case, the RESERVED binding is the ethernet interface
          with port-channel stored in channel-group field.
          When this channel-group is not 0, we know to create a port binding
          as a port-channel instead of interface ethernet.