Clean up context usage
Don't use nova context where openstack.common is enough. Change-Id: Ide2198758faece70fc8cd44ffd9a46d0972e423e Signed-off-by: Julien Danjou <julien@danjou.info>
This commit is contained in:
parent
70eab31d43
commit
dff3bd6dcd
@ -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
|
||||
|
@ -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",
|
||||
|
@ -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)
|
||||
|
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user