summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYun Mao <yunmao@gmail.com>2012-08-07 10:34:45 -0400
committerYun Mao <yunmao@gmail.com>2012-08-07 10:48:53 -0400
commit820ac93531b4f7254cd73b7e98b93dbf361e173f (patch)
treebf8f4d6ec67c2fecd082af65d986b6508b32399c
parent79a2ea2f5f83dc401d089e357bf35dbdfb8be959 (diff)
downloadnova-820ac93531b4f7254cd73b7e98b93dbf361e173f.tar.gz
nova-820ac93531b4f7254cd73b7e98b93dbf361e173f.tar.xz
nova-820ac93531b4f7254cd73b7e98b93dbf361e173f.zip
Remove deprecated use Exception.message
This usage is deprecated since Python 2.6. Use the recommended style instead. str is also replaced with unicode. Change-Id: I2adfd7fdfdf47b70ef170a2daa28926764cf0337
-rw-r--r--nova/tests/test_libvirt.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/nova/tests/test_libvirt.py b/nova/tests/test_libvirt.py
index db00334ea..c43512c10 100644
--- a/nova/tests/test_libvirt.py
+++ b/nova/tests/test_libvirt.py
@@ -1928,9 +1928,9 @@ class LibvirtConnTestCase(test.TestCase):
conn.spawn(self.context, instance, None, network_info)
except Exception, e:
# assert that no exception is raised due to sha1 receiving an int
- self.assertEqual(-1, str(e.message).find('must be string or buffer'
- ', not int'))
- count = (0 <= str(e.message).find('Unexpected method call'))
+ self.assertEqual(-1, unicode(e).find('must be string or buffer'
+ ', not int'))
+ count = (0 <= unicode(e).find('Unexpected method call'))
path = os.path.join(FLAGS.instances_path, instance.name)
if os.path.isdir(path):