def _delete_switch_entry(self, port, vlan_id, device_id, host_id, vni,<EOL>is_provider_vlan):
connections = self._get_active_port_connections(port, host_id)<EOL>vlan_already_removed = []<EOL>for switch_ip, intf_type, nexus_port, is_native, _ in connections:<EOL><INDENT>port_id = nexus_help.format_interface_name(intf_type, nexus_port)<EOL>auto_create = True<EOL>auto_trunk = True<EOL>if is_provider_vlan:<EOL><INDENT>auto_create = cfg.CONF.ml2_cisco.provider_vlan_auto_create<EOL>auto_trunk = cfg.CONF.ml2_cisco.provider_vlan_auto_trunk<EOL><DEDENT>try:<EOL><INDENT>nxos_db.get_port_vlan_switch_binding(port_id, vlan_id,<EOL>switch_ip)<EOL><DEDENT>except excep.NexusPortBindingNotFound:<EOL><INDENT>pass<EOL><DEDENT>else:<EOL><INDENT>continue<EOL><DEDENT>if auto_trunk:<EOL><INDENT>self.driver.disable_vlan_on_trunk_int(<EOL>switch_ip, vlan_id, intf_type, nexus_port,<EOL>is_native)<EOL><DEDENT>if auto_create:<EOL><INDENT>try:<EOL><INDENT>nxos_db.get_nexusvlan_binding(vlan_id, switch_ip)<EOL><DEDENT>except excep.NexusPortBindingNotFound:<EOL><INDENT>if switch_ip not in vlan_already_removed:<EOL><INDENT>self.driver.delete_vlan(switch_ip, vlan_id)<EOL>vlan_already_removed.append(switch_ip)<EOL><DEDENT><DEDENT><DEDENT>self._delete_port_channel_resources(<EOL>host_id, switch_ip, intf_type, nexus_port, port_id)<EOL><DEDENT>if nexus_help.is_baremetal(port):<EOL><INDENT>connections = self._get_baremetal_connections(<EOL>port, False, True)<EOL>for switch_ip, intf_type, nexus_port, is_native, _ in connections:<EOL><INDENT>if_id = nexus_help.format_interface_name(<EOL>intf_type, nexus_port)<EOL>try:<EOL><INDENT>mapping = nxos_db.get_switch_if_host_mappings(<EOL>switch_ip, if_id)<EOL>ch_grp = mapping[<NUM_LIT:0>].ch_grp<EOL><DEDENT>except excep.NexusHostMappingNotFound:<EOL><INDENT>ch_grp = <NUM_LIT:0><EOL><DEDENT>bind_port_id = nexus_help.format_interface_name(<EOL>intf_type, nexus_port, ch_grp)<EOL>binding = nxos_db.get_port_switch_bindings(<EOL>bind_port_id,<EOL>switch_ip)<EOL>if not binding:<EOL><INDENT>nxos_db.remove_host_mapping(if_id, switch_ip)<EOL><DEDENT><DEDENT><DEDENT>
Delete the nexus switch entry.

        By accessing the current db entries determine if switch
        configuration can be removed.

        Called during delete postcommit port event.