def _remove_vlan_from_all_sp_templates(self, handle, vlan_id, ucsm_ip):
sp_template_info_list = (<EOL>CONF.ml2_cisco_ucsm.ucsms[ucsm_ip].sp_template_list.values())<EOL>vlan_name = self.make_vlan_name(vlan_id)<EOL>virtio_port_list = (<EOL>CONF.ml2_cisco_ucsm.ucsms[ucsm_ip].ucsm_virtio_eth_ports)<EOL>try:<EOL><INDENT>for sp_template_info in sp_template_info_list:<EOL><INDENT>sp_template_path = sp_template_info.path<EOL>sp_template = sp_template_info.name<EOL>sp_template_full_path = (sp_template_path +<EOL>const.SP_TEMPLATE_PREFIX + sp_template)<EOL>obj = handle.query_dn(sp_template_full_path)<EOL>if not obj:<EOL><INDENT>LOG.error('<STR_LIT>'<EOL>'<STR_LIT>',<EOL>sp_template_full_path)<EOL>continue<EOL><DEDENT>eth_port_paths = ["<STR_LIT>" % (sp_template_full_path, ep)<EOL>for ep in virtio_port_list]<EOL>for eth_port_path in eth_port_paths:<EOL><INDENT>eth = handle.query_dn(eth_port_path)<EOL>if eth:<EOL><INDENT>vlan_path = (eth_port_path +<EOL>const.VLAN_PATH_PREFIX + vlan_name)<EOL>vlan = handle.query_dn(vlan_path)<EOL>if vlan:<EOL><INDENT>handle.remove_mo(vlan)<EOL><DEDENT>else:<EOL><INDENT>LOG.debug('<STR_LIT>'<EOL>'<STR_LIT>', vlan_name, eth_port_path)<EOL><DEDENT><DEDENT>else:<EOL><INDENT>LOG.debug('<STR_LIT>'<EOL>'<STR_LIT>', eth_port_path)<EOL><DEDENT><DEDENT>handle.commit()<EOL>return True<EOL><DEDENT><DEDENT>except Exception as e:<EOL><INDENT>raise cexc.UcsmConfigDeleteFailed(config=vlan_id,<EOL>ucsm_ip=ucsm_ip,<EOL>exc=e)<EOL><DEDENT>
Deletes VLAN config from all SP Templates that have it.