mirror of
https://github.com/retspen/webvirtcloud
synced 2026-11-09 19:56:48 +00:00
feat(console): VNC is the only console type
SPICE was removed earlier; its leftovers and the console type choice go too: - the console settings form, update_console and the backend no longer offer or change the type; an invalid console form now shows its errors instead of being ignored; - the create form, the API serializer and create_instance no longer take a graphics type, new VMs get VNC; get_graphics_types and the graphics entries of the domain capabilities are gone; - migration appsettings.0013 deletes QEMU_CONSOLE_DEFAULT_TYPE; - a VM defined elsewhere with another graphics type gets "Console type ... is not supported". The locale catalogs still reference the deleted SPICE templates in source comments; regenerating them is left to the translation work.
This commit is contained in:
parent
9f86330552
commit
e5fda79f5a
18 changed files with 74 additions and 127 deletions
|
|
@ -14,7 +14,7 @@ import threading
|
|||
|
||||
class _TunnelScheduler(object):
|
||||
"""
|
||||
If the user is using Spice + SSH URI + no SSH keys, we need to
|
||||
If the user is using an SSH URI without SSH keys, we need to
|
||||
serialize connection opening otherwise ssh-askpass gets all angry.
|
||||
This handles the locking and scheduling.
|
||||
It's only instantiated once for the whole app, because we serialize
|
||||
|
|
@ -181,7 +181,7 @@ class SSHTunnels(object):
|
|||
self._tunnels.append(t)
|
||||
|
||||
# socket FDs are closed when the object is garbage collected. This
|
||||
# can close an FD behind spice/vnc's back which causes crashes.
|
||||
# can close an FD behind the VNC client's back which causes crashes.
|
||||
#
|
||||
# Dup a bare FD for the viewer side of things, but keep the high
|
||||
# level socket object for the SSH side, since it simplifies things
|
||||
|
|
|
|||
|
|
@ -108,9 +108,10 @@ class ConsoleViewsTestCase(TestCase):
|
|||
self.assertEqual(response.context["ws_port"], 5900)
|
||||
|
||||
@patch("console.views.wvmInstance")
|
||||
def test_console_superuser_spice_deprecated(self, mock_wvm):
|
||||
def test_console_unsupported_graphics_type(self, mock_wvm):
|
||||
# Only VNC is supported; a VM defined elsewhere may use another type.
|
||||
mock_conn = MagicMock()
|
||||
mock_conn.get_console_type.return_value = "spice"
|
||||
mock_conn.get_console_type.return_value = "rdp"
|
||||
mock_conn.get_console_websocket_port.return_value = None
|
||||
mock_wvm.return_value = mock_conn
|
||||
|
||||
|
|
@ -120,7 +121,7 @@ class ConsoleViewsTestCase(TestCase):
|
|||
|
||||
self.assertEqual(response.status_code, 200)
|
||||
self.assertTemplateUsed(response, "console-vnc-lite.html")
|
||||
self.assertIn("SPICE", str(response.context["console_error"]))
|
||||
self.assertIn("'rdp' is not supported", str(response.context["console_error"]))
|
||||
|
||||
@override_settings(SERIAL_CONSOLE_ENABLED=True)
|
||||
@patch("console.views.wvmInstance")
|
||||
|
|
|
|||
|
|
@ -156,15 +156,10 @@ def console(request):
|
|||
console_error = _(
|
||||
"Fail to get console. Please check the console configuration of your VM."
|
||||
)
|
||||
elif console_type == "spice":
|
||||
console_error = _(
|
||||
"SPICE console protocol is deprecated and no longer supported. "
|
||||
"Please switch VM graphics to VNC."
|
||||
)
|
||||
else:
|
||||
console_error = _("Console type '%(type)s' has not support") % {
|
||||
"type": console_type
|
||||
}
|
||||
console_error = _(
|
||||
"Console type '%(type)s' is not supported. Please switch the VM graphics to VNC."
|
||||
) % {"type": console_type}
|
||||
response = render(request, "console-vnc-lite.html", locals())
|
||||
|
||||
# Only novncd reads this cookie; JavaScript gets the token from the page.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue