1
0
Fork 0
mirror of https://github.com/retspen/webvirtcloud synced 2026-12-03 09:26:03 +00:00

fix(interfaces): a new interface never replaces one the host defines

- The create form refuses a name the host already defines. Defining it
  again replaced that interface's configuration, for example the host's
  own uplink when a bridge was named after it.
- An interface that does not start is undefined again, so the name is
  free for another try; the name check above makes this safe.
This commit is contained in:
catborise 2026-10-26 15:41:01 +03:00
parent 4c2d339bcf
commit b48fee71d5
4 changed files with 35 additions and 11 deletions

View file

@ -55,7 +55,7 @@ def interfaces(request, compute_id):
# the page says why nothing is created on a host that cannot change
# interfaces; without the host's devices nothing can be checked
if "create" in request.POST and changeable and netdev_error is None:
form = AddInterface(request.POST, netdevs=netdevs)
form = AddInterface(request.POST, netdevs=netdevs, defined=ifaces)
if form.is_valid():
data = form.cleaned_data
with audit(request, compute, f"Interface {data['name']}", "add"):