diff --git a/examples/answers-bond.yaml b/examples/answers-bond.yaml index 756a8ab1..115b8f5a 100644 --- a/examples/answers-bond.yaml +++ b/examples/answers-bond.yaml @@ -24,6 +24,13 @@ Network: action: EDIT_IPV4 method-data: method: dhcp + - obj: [interface name bond10] + action: DELETE + - action: create-bond + data: + name: bond10 + devices: + - [interface index 0] - action: done Proxy: proxy: "" diff --git a/subiquitycore/ui/views/network.py b/subiquitycore/ui/views/network.py index c54c81f9..f9146732 100644 --- a/subiquitycore/ui/views/network.py +++ b/subiquitycore/ui/views/network.py @@ -129,16 +129,17 @@ class NetworkView(BaseView): _action_EDIT_BOND = _stretchy_shower(BondStretchy) _action_ADD_VLAN = _stretchy_shower(AddVlanStretchy) - def _action_DELETE(self, device): - touched_devs = set() - if device.type == "bond": - for name in device.config['interfaces']: - touched_devs.add(self.model.get_netdev_by_name(name)) - device.config = None - self.del_link(device) - for dev in touched_devs: - self.update_link(dev) - self.controller.apply_config() + def _action_DELETE(self, name, device): + with self.controller.context.child(name): + touched_devs = set() + if device.type == "bond": + for name in device.config['interfaces']: + touched_devs.add(self.model.get_netdev_by_name(name)) + device.config = None + self.del_link(device) + for dev in touched_devs: + self.update_link(dev) + self.controller.apply_config() def _action(self, sender, action, device): action, meth = action