Add context argument a lot more places and make unit tests work

This commit is contained in:
Kevin L. Mitchell
2011-07-27 17:16:46 +00:00
parent 435abc16d0
commit b847ed1cba
11 changed files with 42 additions and 34 deletions

View File

@@ -365,7 +365,7 @@ class LibvirtConnTestCase(test.TestCase):
self.mox.ReplayAll()
conn = connection.LibvirtConnection(False)
conn.snapshot(instance_ref, recv_meta['id'])
conn.snapshot(self.context, instance_ref, recv_meta['id'])
snapshot = image_service.show(context, recv_meta['id'])
self.assertEquals(snapshot['properties']['image_state'], 'available')
@@ -405,7 +405,7 @@ class LibvirtConnTestCase(test.TestCase):
self.mox.ReplayAll()
conn = connection.LibvirtConnection(False)
conn.snapshot(instance_ref, recv_meta['id'])
conn.snapshot(self.context, instance_ref, recv_meta['id'])
snapshot = image_service.show(context, recv_meta['id'])
self.assertEquals(snapshot['properties']['image_state'], 'available')
@@ -775,7 +775,7 @@ class LibvirtConnTestCase(test.TestCase):
network_info = [(network, mapping)]
try:
conn.spawn(instance, network_info)
conn.spawn(context.get_admin_context(), instance, network_info)
except Exception, e:
count = (0 <= str(e.message).find('Unexpected method call'))