1
0
Fork 0
mirror of https://github.com/retspen/webvirtcloud synced 2026-11-09 19:56:48 +00:00

fix(instances): a disk resize returns to the Disks sub-tab

607c8381 sent each memory and disk resize back to its own sub-tab, but
the disk view's last redirect, the one after a resize was tried, still
went to #resize, which opens on the CPU sub-tab. Only the live tests
reach it, with a disk to grow: the full live suite failed there on every
connection type.

The live vCPU test built its post from the page's form, and the page now
disables the CPU fields while the VM runs, so the post lacked cur_vcpu
and was refused as not a number before the running VM was. It now posts
both fields, as the direct post it checks.
This commit is contained in:
catborise 2026-11-04 23:56:32 +03:00
parent 84dfbd5884
commit 02d4d02757
2 changed files with 4 additions and 3 deletions

View file

@ -464,8 +464,9 @@ class LiveDataLossTestCase(TestCase):
options = form("change_options")
self.assertEqual(options["title"], "wvc-title")
self.post("change_options", inst, {**options, "description": "wvc-description"})
# vCPUs are refused: the VM would get them at its next start, past the quota counted now
response = self.post("resizevm_cpu", inst, {**form("resizevm_cpu"), "vcpu": "2"})
# vCPUs are refused: the VM would get them at its next start, past the quota counted now;
# the page disables their fields while it runs, so this is a direct post of both
response = self.post("resizevm_cpu", inst, {**form("resizevm_cpu"), "vcpu": "2", "cur_vcpu": "1"})
self.assertIn("Shut off the VM to change its vCPUs",
[str(m) for m in get_messages(response.wsgi_request)])

View file

@ -1271,7 +1271,7 @@ def resize_disk(request, pk):
continue
messages.success(request, _("Disk is resized: %(dev)s") % {"dev": disk["dev"]})
return redirect(reverse("instances:instance", args=[instance.id]) + "#resize")
return redirect(reverse("instances:instance", args=[instance.id]) + "#resizevm_disk")
@require_POST