diff --git a/novaclient/v1_1/servers.py b/novaclient/v1_1/servers.py index 9018003d4..6388ffb47 100644 --- a/novaclient/v1_1/servers.py +++ b/novaclient/v1_1/servers.py @@ -517,7 +517,9 @@ class ServerManager(local_base.BootingManagerWithFind): you would like to retrieve. :param length: The number of tail loglines you would like to retrieve. """ - return self._action('os-getConsoleOutput', server, {'length': length}) + return self._action('os-getConsoleOutput', + server, + {'length': length})[1]['output'] def delete_meta(self, server, keys): """ diff --git a/tests/v1_1/fakes.py b/tests/v1_1/fakes.py index 9f2ee7146..a0810c4c5 100644 --- a/tests/v1_1/fakes.py +++ b/tests/v1_1/fakes.py @@ -302,7 +302,7 @@ class FakeHTTPClient(base_client.HTTPClient): assert body[action].keys() == ['adminPass'] elif action == 'os-getConsoleOutput': assert body[action].keys() == ['length'] - return (202, "foo") + return (202, {'output': 'foo'}) else: raise AssertionError("Unexpected server action: %s" % action) return (202, _body) diff --git a/tests/v1_1/test_servers.py b/tests/v1_1/test_servers.py index 81ac784a2..60913946e 100644 --- a/tests/v1_1/test_servers.py +++ b/tests/v1_1/test_servers.py @@ -202,7 +202,7 @@ class ServersTest(utils.TestCase): cs.assert_called('POST', '/servers/1234/action') def test_get_console_output_without_length(self): - success = ({'status': 202}, 'foo') + success = 'foo' s = cs.servers.get(1234) s.get_console_output() self.assertEqual(s.get_console_output(), success) @@ -213,7 +213,8 @@ class ServersTest(utils.TestCase): cs.assert_called('POST', '/servers/1234/action') def test_get_console_output_with_length(self): - success = ({'status': 202}, 'foo') + success = 'foo' + s = cs.servers.get(1234) s.get_console_output(length=50) self.assertEqual(s.get_console_output(length=50), success)