def delete_loopback_interface(obj): name = None try: name = obj.get_attr_data('if/interfaces/interface/name') except: return False return dn_base_ip_tool.delete_if(name)
def __delete_vlan_sub_if(parent_intf, vlan_id): """Method to delete VLAN SubInterface in Linux""" vlan_subintf_name = str(parent_intf) + '.' + str(vlan_id) if dn_base_ip_tool.delete_if(vlan_subintf_name) is False: nas_if.log_err("Failed to delete VLAN SubInterface for " + str(vlan_subintf_name)) return False nas_if.log_info("Successfully deleted VLAN SubInterface " + str(vlan_subintf_name)) return True
def __delete_vtep_if(vtep_name): """Method to delete vtep interface in Linux""" if __if_present(vtep_name) is True and \ dn_base_ip_tool.delete_if(vtep_name): nas_if.log_info("Successfully deleted VTEP Interface " + str(vtep_name)) return True nas_if.log_err("Failed to delete VTEP Interface " + str(vtep_name)) return False
def delete_macvlan_interface(obj): data = obj.get()['data'] nas_if.log_info("data = " + str(data)) if if_name not in data: nas_if.log_err("Missing Maclvan interface name") return False name = obj.get_attr_data(if_name) if name is None: nas_if.log_err("Empty Macvlan interface name") nas_if.log_info("Macvlan interface to be deleted = " + str(name)) return dn_base_ip_tool.delete_if(name)
def handle_delete_op(obj): name = _get_name_from_obj(obj) dn_base_ip_tool.delete_if(name)