summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlban Lecorps <alban.lecorps@ubisoft.com>2022-10-31 11:52:53 +0100
committerAlban Lecorps <alban.lecorps@ubisoft.com>2022-11-02 11:03:20 +0100
commitee92961fe5275f85779634aad637d00c15802b49 (patch)
tree1608de93c0160560547de43a103c205f1d10a2aa
parent516e57bc895c184756900fa9c6e15110e7ecf805 (diff)
downloadhorizon-ee92961fe5275f85779634aad637d00c15802b49.tar.gz
Remove console_type parameter for server_mks_console function
The "get_mks_console" use "console_type" as param, but causes an issue on Nova. In horizon logs we have "Recoverable error: No available console found." and in the dashboard we have "Unable to load console. Please reload page to try again." when we load the console. There is no need to call the function with this parameter, as it's already defined automatically since microversion 2.53. Change-Id: I776b19f053ca74c699ca069e04553740f1e83b3e
-rw-r--r--openstack_dashboard/api/nova.py4
-rw-r--r--openstack_dashboard/test/unit/api/test_nova.py6
2 files changed, 4 insertions, 6 deletions
diff --git a/openstack_dashboard/api/nova.py b/openstack_dashboard/api/nova.py
index 03bdee1a9..3d403caa2 100644
--- a/openstack_dashboard/api/nova.py
+++ b/openstack_dashboard/api/nova.py
@@ -222,10 +222,10 @@ def server_serial_console(request, instance_id, console_type='serial'):
@profiler.trace
-def server_mks_console(request, instance_id, console_type='mks'):
+def server_mks_console(request, instance_id):
microver = get_microversion(request, "remote_console_mks")
nc = _nova.novaclient(request, microver)
- console = nc.servers.get_mks_console(instance_id, console_type)
+ console = nc.servers.get_mks_console(instance_id)
return MKSConsole(console['remote_console'])
diff --git a/openstack_dashboard/test/unit/api/test_nova.py b/openstack_dashboard/test/unit/api/test_nova.py
index d394b78f7..fb0df1d7d 100644
--- a/openstack_dashboard/test/unit/api/test_nova.py
+++ b/openstack_dashboard/test/unit/api/test_nova.py
@@ -151,19 +151,17 @@ class ComputeApiTests(test.APIMockTestCase):
def test_server_mks_console(self, mock_novaclient):
server = self.servers.first()
console = self.servers.mks_console_data
- console_type = console["remote_console"]["type"]
novaclient = mock_novaclient.return_value
self._mock_current_version(novaclient, '2.53')
novaclient.servers.get_mks_console.return_value = console
ret_val = api.nova.server_mks_console(self.request,
- server.id,
- console_type)
+ server.id)
self.assertIsInstance(ret_val, api.nova.MKSConsole)
novaclient.versions.get_current.assert_called_once_with()
novaclient.servers.get_mks_console.assert_called_once_with(
- server.id, console_type)
+ server.id)
@mock.patch.object(api._nova, 'novaclient')
def test_server_list(self, mock_novaclient):