Merge "Clean up context usage"

This commit is contained in:
Jenkins 2012-10-30 14:15:51 +00:00 committed by Gerrit Code Review
commit aae84287b0
4 changed files with 5 additions and 5 deletions

View File

@ -20,12 +20,12 @@ import functools
import itertools
import pkg_resources
from nova import context
from nova import manager
from ceilometer import meter
from ceilometer import publish
from ceilometer import storage
from ceilometer.openstack.common import context
from ceilometer.openstack.common import cfg
from ceilometer.openstack.common import log
from ceilometer.openstack.common import timeutils

View File

@ -81,7 +81,7 @@ class TestNovaNotifier(base.TestCase):
flags.FLAGS.compute_driver = 'nova.virt.fake.FakeDriver'
flags.FLAGS.notification_driver = [nova_notifier.__name__]
self.compute = importutils.import_object(flags.FLAGS.compute_manager)
self.context = context.RequestContext('admin', 'admin', is_admin=True)
self.context = context.get_admin_context()
fake_network.set_stub_network_methods(self.stubs)
self.instance = {"name": "instance-1",

View File

@ -91,7 +91,7 @@ class TestImagePollster(base.TestCase):
def setUp(self):
super(TestImagePollster, self).setUp()
self.context = context.RequestContext('admin', 'admin', is_admin=True)
self.context = context.get_admin_context()
self.manager = manager.AgentManager()
self.stubs.Set(glance._Base, 'iter_images',
self.fake_glance_iter_images)

View File

@ -19,11 +19,11 @@
import mock
from nova import context
from nova import db
from ceilometer.network import floatingip
from ceilometer.central import manager
from ceilometer.openstack.common import context
from ceilometer.tests import base
@ -31,7 +31,7 @@ class TestFloatingIPPollster(base.TestCase):
def setUp(self):
super(TestFloatingIPPollster, self).setUp()
self.context = context.RequestContext('admin', 'admin', is_admin=True)
self.context = context.get_admin_context()
self.manager = manager.AgentManager()
self.pollster = floatingip.FloatingIPPollster()
self.stubs.Set(db, 'floating_ip_get_all', self.faux_get_ips)