def _get_switch_interfaces(self, requested_switch_ip, cfg_only=False):
switch_ifs = []<EOL>try:<EOL><INDENT>port_info = nxos_db.get_switch_host_mappings(<EOL>requested_switch_ip)<EOL><DEDENT>except excep.NexusHostMappingNotFound:<EOL><INDENT>port_info = []<EOL><DEDENT>for binding in port_info:<EOL><INDENT>if cfg_only and not binding.is_static:<EOL><INDENT>continue<EOL><DEDENT>intf_type, port = nexus_help.split_interface_name(<EOL>binding.if_id)<EOL>switch_ifs.append(<EOL>(requested_switch_ip, intf_type, port,<EOL>const.NOT_NATIVE, binding.ch_grp))<EOL><DEDENT>return switch_ifs<EOL>
Get switch interfaces from host mapping DB.

        For a given switch, this returns all known port
        interfaces for a given switch.  These have been
        learned from received baremetal transactions and
        from configuration file.

        :param requested_switch_ip: switch_ip
        :returns: list of switch_ip, intf_type, port_id, is_native