1
0
Fork 0
mirror of https://github.com/retspen/webvirtcloud synced 2026-12-01 16:36:06 +00:00

fix(instances): a disk form loaded before the disk changed changes nothing

The Edit, Detach and Delete forms of a VM's disk name it by its device:
the view acted on whatever disk had that device by then. A form loaded
before a disk move, an external snapshot or another tab's change wrote the
old path back over the new one (the VM then starts from an old or deleted
file), or detached and deleted the volume that replaced it.

The forms already send the path they show. The views now refuse a disk
whose path is not that one, and tell the user to reload the page. Turkish
and Chinese texts included.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Kk4h2TcUiaWmU5MUszYSea
This commit is contained in:
catborise 2026-11-11 12:39:40 +03:00
parent a53a3623d2
commit 34048dce83
10 changed files with 433 additions and 374 deletions

View file

@ -150,9 +150,9 @@ class VMRowTests(TestCase):
self.proxy.paths_used_by_other_domains.return_value = set()
with patch("instances.views.wvmStorage"):
self.proxy.wait_disk_detached.return_value = False
self.post("delete_vol", {"dev": "vdb"})
self.post("delete_vol", {"dev": "vdb", "path": "/pool/data.qcow2"})
self.proxy.wait_disk_detached.return_value = True
self.post("delete_vol", {"dev": "vdb"})
self.post("delete_vol", {"dev": "vdb", "path": "/pool/data.qcow2"})
self.assertEqual(self.rows(), [
("VM vm: detach disk vdb", True),
("VM vm: delete volume default/data.qcow2: the guest has not released the disk", False),