mirror of
https://github.com/retspen/webvirtcloud
synced 2026-11-10 20:26:48 +00:00
fix(logs): failures name their job, VM and user; the new VM form shows a list it could not load
- A failed cancel hook logged "worker task cancel failed": it now names
the job, its kind, resource and user, with the traceback for a fault
of the panel.
- novncd logged "Console connection failed" without the VM or the user.
- django-axes wrote four INFO lines a login ("Reset 0 access
attempts"...); logins are on the Logs page, so it logs warnings only.
- The new VM form's machine types and disk buses answered 200 with an
empty object when libvirt failed, and nothing was logged: the list
stayed empty, the form could not go on and said nothing. They answer
400 with the error, as the pool's volume list does, the warning is
logged with the compute, and the form's lists show an error they get
with the page's messages.
This commit is contained in:
parent
432b1505b3
commit
6abea495f1
14 changed files with 155 additions and 40 deletions
|
|
@ -71,7 +71,7 @@ class GraphTestCase(TestCase):
|
|||
self.assertEqual((data["cpudata"], data["memdata"]["total"]), (None, None))
|
||||
self.assertNotIn("cpu_sample", data)
|
||||
|
||||
def test_a_host_that_cannot_be_connected_to_answers_without_values(self):
|
||||
def test_a_host_that_cannot_be_connected_to_answers_without_values_or_with_its_error(self):
|
||||
down = ConnectionFailed("192.0.2.1 is down")
|
||||
with patch("computes.views.wvmHostDetails", side_effect=down), patch(
|
||||
"computes.models.wvmHostDetails", side_effect=down
|
||||
|
|
@ -79,7 +79,9 @@ class GraphTestCase(TestCase):
|
|||
self.assertIsNone(self.graph()["cpudata"])
|
||||
for url in (reverse("machines", args=[self.compute.id, "x86_64"]),
|
||||
reverse("buses", args=[self.compute.id, "x86_64", "q35", "disk"])):
|
||||
self.assertEqual(json.loads(self.client.get(url).content), {})
|
||||
# a list the new VM form waits for: the error, not an empty answer
|
||||
response = self.client.get(url)
|
||||
self.assertEqual((response.status_code, json.loads(response.content)), (400, {"error": "192.0.2.1 is down"}))
|
||||
|
||||
|
||||
@unittest.skipUnless(shutil.which("node"), "node is not installed")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue