mirror of
https://github.com/retspen/webvirtcloud
synced 2026-12-01 08:26:03 +00:00
perf(instances): the new VM page does not list the host's VMs or read its capabilities
The page never showed either: get_instances() looked up every running domain and get_capabilities() parsed the host capabilities on each load, and both results were thrown away. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Kk4h2TcUiaWmU5MUszYSea
This commit is contained in:
parent
ce98bc85d0
commit
6f12e10091
2 changed files with 2 additions and 5 deletions
|
|
@ -109,7 +109,6 @@ class CreateInstanceViewTests(TestCase):
|
|||
conn.get_network_models.return_value = ["virtio"]
|
||||
conn.get_storages.return_value = ["default"]
|
||||
conn.get_dom_capabilities.return_value = {"loader_enums": [], "loaders": [], "cpu_modes": ["host-model"]}
|
||||
conn.get_capabilities.return_value = {}
|
||||
conn.get_firmwares.return_value = ["BIOS", "UEFI", "UEFI Secure Boot"]
|
||||
conn.get_tpm_model.return_value = "tpm-crb"
|
||||
for method, value in (host or {}).items():
|
||||
|
|
@ -147,14 +146,12 @@ class CreateInstanceViewTests(TestCase):
|
|||
name="create-fw-compute", hostname="localhost", type=4, login="", password="",
|
||||
)
|
||||
conn = connection_class.return_value
|
||||
conn.get_instances.return_value = []
|
||||
conn.get_storages.return_value = []
|
||||
conn.get_networks.return_value = []
|
||||
conn.get_nwfilters.return_value = []
|
||||
conn.get_cache_modes.return_value = {}
|
||||
# A host without loader support has no "loaders"/"loader_enums" keys
|
||||
conn.get_dom_capabilities.return_value = {"loader_support": "no", "cpu_modes": ["host-model"]}
|
||||
conn.get_capabilities.return_value = {}
|
||||
conn.get_firmwares.return_value = ["BIOS"]
|
||||
conn.get_tpm_model.return_value = None
|
||||
|
||||
|
|
@ -162,6 +159,8 @@ class CreateInstanceViewTests(TestCase):
|
|||
|
||||
self.assertEqual(response.status_code, 200)
|
||||
conn.get_firmwares.assert_called_once_with("x86_64", "q35")
|
||||
conn.get_instances.assert_not_called() # the page lists no VMs
|
||||
conn.get_capabilities.assert_not_called()
|
||||
# a fresh host: what to do, not that the user defined nothing
|
||||
self.assertContains(response, "This host has no running storage pool for the VM's disks: add or start one on its Storage page.")
|
||||
conn.get_storages.return_value = ["default"]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue