summaryrefslogtreecommitdiffstats
path: root/nova/test.py
diff options
context:
space:
mode:
authorVishvananda Ishaya <vishvananda@yahoo.com>2010-10-13 22:18:01 -0700
committerVishvananda Ishaya <vishvananda@yahoo.com>2010-10-13 22:18:01 -0700
commit14e956b2319821ef9d6f595347e4057413f2c0ee (patch)
tree9f927f506fd8c9a24a1a04b11edbe72ee5b2ef07 /nova/test.py
parent68e716cbb2901e8f54291aacdcf4f2dc1d0a47ff (diff)
downloadnova-14e956b2319821ef9d6f595347e4057413f2c0ee.tar.gz
nova-14e956b2319821ef9d6f595347e4057413f2c0ee.tar.xz
nova-14e956b2319821ef9d6f595347e4057413f2c0ee.zip
cleaned up most of the issues
Diffstat (limited to 'nova/test.py')
-rw-r--r--nova/test.py13
1 files changed, 8 insertions, 5 deletions
diff --git a/nova/test.py b/nova/test.py
index f6485377d..b9ea36e1d 100644
--- a/nova/test.py
+++ b/nova/test.py
@@ -32,6 +32,7 @@ from tornado import ioloop
from twisted.internet import defer
from twisted.trial import unittest
+from nova import context
from nova import db
from nova import fakerabbit
from nova import flags
@@ -64,8 +65,9 @@ class TrialTestCase(unittest.TestCase):
# now that we have some required db setup for the system
# to work properly.
self.start = datetime.datetime.utcnow()
- if db.network_count(None) != 5:
- network_manager.VlanManager().create_networks(None,
+ ctxt = context.get_admin_context()
+ if db.network_count(ctxt) != 5:
+ network_manager.VlanManager().create_networks(ctxt,
FLAGS.fixed_range,
5, 16,
FLAGS.vlan_start,
@@ -87,8 +89,9 @@ class TrialTestCase(unittest.TestCase):
self.stubs.SmartUnsetAll()
self.mox.VerifyAll()
# NOTE(vish): Clean up any ips associated during the test.
- db.fixed_ip_disassociate_all_by_timeout(None, FLAGS.host, self.start)
- db.network_disassociate_all(None)
+ ctxt = context.get_admin_context()
+ db.fixed_ip_disassociate_all_by_timeout(ctxt, FLAGS.host, self.start)
+ db.network_disassociate_all(ctxt)
rpc.Consumer.attach_to_twisted = self.originalAttach
for x in self.injected:
try:
@@ -98,7 +101,7 @@ class TrialTestCase(unittest.TestCase):
if FLAGS.fake_rabbit:
fakerabbit.reset_all()
- db.security_group_destroy_all(None)
+ db.security_group_destroy_all(ctxt)
super(TrialTestCase, self).tearDown()