def remove_interface(self, name): name = self.clean_iface_name(name) if name not in self.interfaces: raise KeyError("%s does not have an interface on %s" % (self, name)) logger.info("Removing interface %s from %s", name, self) is_active = self.is_active nic = Nic(name) if is_active: nic.ifdown() nic.config.remove() nic.config.save() return True