mirror of
https://github.com/retspen/webvirtcloud
synced 2026-12-02 08:56:07 +00:00
fix(admin): Removed VMs shows the host a VM left and confirms a delete
A tombstone kept the VM's name and UUID but not its compute, so the page could not say where the VM had been. It now stores the compute's name (as text: the compute may be the one deleted) and the list shows it; records made before this have no host. Deleting a record says so, and the admin tables use scope="col" instead of the invalid span="col". Closes #217
This commit is contained in:
parent
f7279610a8
commit
6c2704f97d
9 changed files with 47 additions and 19 deletions
|
|
@ -142,7 +142,8 @@ class OwnershipTestCase(TestCase):
|
|||
def test_a_host_added_again_gets_its_vms_back_with_their_owners(self):
|
||||
self.owned_vm(self.host_a)
|
||||
self.delete(self.host_a)
|
||||
self.assertEqual(InstanceTombstone.objects.get().owners[0]["user"], self.owner.id)
|
||||
tombstone = InstanceTombstone.objects.get()
|
||||
self.assertEqual((tombstone.owners[0]["user"], tombstone.host), (self.owner.id, "host-a"))
|
||||
self.assertEqual(self.rows(), [
|
||||
("cd-admin", "-", "Login"),
|
||||
("-", "host-a", f"VM vm ({UUID}): owners kept on the Removed VMs page"),
|
||||
|
|
|
|||
|
|
@ -100,7 +100,8 @@ def _bury(inst):
|
|||
for ui in UserInstance.objects.filter(instance=inst)
|
||||
]
|
||||
if owners or inst.is_template:
|
||||
InstanceTombstone.objects.create(uuid=inst.uuid, name=inst.name, is_template=inst.is_template, owners=owners)
|
||||
InstanceTombstone.objects.create(uuid=inst.uuid, name=inst.name, host=inst.compute.name,
|
||||
is_template=inst.is_template, owners=owners)
|
||||
_log(inst, "owners kept on the Removed VMs page")
|
||||
else:
|
||||
_log(inst, "left the panel (no owners)")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue