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

fix(instances): an empty panel says what to do next

- The VM list with no VMs no longer also says that no VM matches the
  search and the state.
- The New VM dialog with no compute yet says to add the first host, with a
  link to the Computes page (and links there when none is reachable).
- The new VM page on a host without a running storage pool or a network
  says what to add or start and where, instead of "You haven't defined any
  storage pools" (also when pools exist but are stopped) and "network
  pools".
This commit is contained in:
catborise 2026-11-07 16:46:03 +03:00
parent 897bcba66f
commit f98c636be3
10 changed files with 278 additions and 225 deletions

View file

@ -162,6 +162,11 @@ class CreateInstanceViewTests(TestCase):
self.assertEqual(response.status_code, 200)
conn.get_firmwares.assert_called_once_with("x86_64", "q35")
# 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"]
response = self.client.get(reverse("instances:create_instance", args=[compute.id, "x86_64", "q35"]))
self.assertContains(response, "This host has no network for the VM: add one on its Networks page.")
class NicMacsTestCase(SimpleTestCase):