summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJosh Kearney <josh@jk0.org>2011-05-06 13:48:19 -0500
committerJosh Kearney <josh@jk0.org>2011-05-06 13:48:19 -0500
commitff036fb229e7ff1c73d6be395fbb3b2807b9eb53 (patch)
tree652d8dbcd7c2cae6404beb8ebad5a99cc97c40df
parent791f8dc895b97caa9395a52113823bde37ae6cfa (diff)
parent016be4ccdfe3f7791021bc717a1445b36cde371f (diff)
downloadnova-ff036fb229e7ff1c73d6be395fbb3b2807b9eb53.tar.gz
nova-ff036fb229e7ff1c73d6be395fbb3b2807b9eb53.tar.xz
nova-ff036fb229e7ff1c73d6be395fbb3b2807b9eb53.zip
Merged trunk
-rw-r--r--Authors1
-rw-r--r--nova/compute/manager.py3
-rw-r--r--nova/tests/test_cloud.py2
-rw-r--r--nova/virt/fake.py2
4 files changed, 5 insertions, 3 deletions
diff --git a/Authors b/Authors
index 1cdeeff99..8a1571a09 100644
--- a/Authors
+++ b/Authors
@@ -80,4 +80,5 @@ Vasiliy Shlykov <vash@vasiliyshlykov.org>
Vishvananda Ishaya <vishvananda@gmail.com>
Yoshiaki Tamura <yoshi@midokura.jp>
Youcef Laribi <Youcef.Laribi@eu.citrix.com>
+Yuriy Taraday <yorik.sar@gmail.com>
Zhixue Wu <Zhixue.Wu@citrix.com>
diff --git a/nova/compute/manager.py b/nova/compute/manager.py
index d92f7719a..e75371741 100644
--- a/nova/compute/manager.py
+++ b/nova/compute/manager.py
@@ -759,7 +759,8 @@ class ComputeManager(manager.SchedulerDependentManager):
instance_ref = self.db.instance_get(context, instance_id)
LOG.audit(_("Get console output for instance %s"), instance_id,
context=context)
- return self.driver.get_console_output(instance_ref)
+ output = self.driver.get_console_output(instance_ref)
+ return output.decode('utf-8', 'replace').encode('ascii', 'replace')
@exception.wrap_exception
def get_ajax_console(self, context, instance_id):
diff --git a/nova/tests/test_cloud.py b/nova/tests/test_cloud.py
index c45bdd12c..f271c03f2 100644
--- a/nova/tests/test_cloud.py
+++ b/nova/tests/test_cloud.py
@@ -290,7 +290,7 @@ class CloudTestCase(test.TestCase):
instance_id = rv['instancesSet'][0]['instanceId']
output = self.cloud.get_console_output(context=self.context,
instance_id=[instance_id])
- self.assertEquals(b64decode(output['output']), 'FAKE CONSOLE OUTPUT')
+ self.assertEquals(b64decode(output['output']), 'FAKE CONSOLE?OUTPUT')
# TODO(soren): We need this until we can stop polling in the rpc code
# for unit tests.
greenthread.sleep(0.3)
diff --git a/nova/virt/fake.py b/nova/virt/fake.py
index 33f37b512..5ac376e46 100644
--- a/nova/virt/fake.py
+++ b/nova/virt/fake.py
@@ -367,7 +367,7 @@ class FakeConnection(driver.ComputeDriver):
return [0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L]
def get_console_output(self, instance):
- return 'FAKE CONSOLE OUTPUT'
+ return 'FAKE CONSOLE\xffOUTPUT'
def get_ajax_console(self, instance):
return {'token': 'FAKETOKEN',