daemon: fix for deleting an interface from rj45 node, better error messaging when trying to add an interface to a node that already exists
This commit is contained in:
parent
4a9d16c78c
commit
4b6afe4db7
2 changed files with 19 additions and 5 deletions
|
@ -837,7 +837,12 @@ class CoreNode(CoreNodeBase):
|
|||
if net.has_custom_iface:
|
||||
return net.custom_iface(self, iface_data)
|
||||
else:
|
||||
iface_id = self.newveth(iface_data.id, iface_data.name)
|
||||
iface_id = iface_data.id
|
||||
if iface_id is not None and iface_id in self.ifaces:
|
||||
raise CoreError(
|
||||
f"node({self.name}) already has interface({iface_id})"
|
||||
)
|
||||
iface_id = self.newveth(iface_id, iface_data.name)
|
||||
self.attachnet(iface_id, net)
|
||||
if iface_data.mac:
|
||||
self.set_mac(iface_id, iface_data.mac)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue