start removing references to AuthManager
This commit is contained in:
@@ -43,8 +43,8 @@ from nova import version
|
||||
FLAGS = flags.FLAGS
|
||||
flags.DEFINE_string('logging_context_format_string',
|
||||
'%(asctime)s %(levelname)s %(name)s '
|
||||
'[%(request_id)s %(user)s '
|
||||
'%(project)s] %(message)s',
|
||||
'[%(request_id)s %(user_id)s '
|
||||
'%(project_id)s] %(message)s',
|
||||
'format string to use for log messages with context')
|
||||
flags.DEFINE_string('logging_default_format_string',
|
||||
'%(asctime)s %(levelname)s %(name)s [-] '
|
||||
|
||||
@@ -38,7 +38,7 @@ class HyperVTestCase(test.TestCase):
|
||||
self.user = self.manager.create_user('fake', 'fake', 'fake',
|
||||
admin=True)
|
||||
self.project = self.manager.create_project('fake', 'fake', 'fake')
|
||||
self.context = context.RequestContext(self.user, self.project)
|
||||
self.context = context.RequestContext(self.user.id, self.project.id)
|
||||
|
||||
def test_create_destroy(self):
|
||||
"""Create a VM and destroy it"""
|
||||
|
||||
@@ -93,7 +93,7 @@ class AccessTestCase(test.TestCase):
|
||||
super(AccessTestCase, self).tearDown()
|
||||
|
||||
def response_status(self, user, methodName):
|
||||
ctxt = context.RequestContext(user, self.project)
|
||||
ctxt = context.RequestContext(user.id, self.project.id)
|
||||
environ = self._env_for(ctxt, methodName)
|
||||
req = webob.Request.blank('/', environ)
|
||||
resp = req.get_response(self.mw)
|
||||
|
||||
@@ -54,8 +54,8 @@ class AdminApiTestCase(test.TestCase):
|
||||
self.manager = manager.AuthManager()
|
||||
self.user = self.manager.create_user('admin', 'admin', 'admin', True)
|
||||
self.project = self.manager.create_project('proj', 'admin', 'proj')
|
||||
self.context = context.RequestContext(user=self.user,
|
||||
project=self.project)
|
||||
self.context = context.RequestContext(user_id=self.user.id,
|
||||
project_id=self.project.id)
|
||||
|
||||
def fake_show(meh, context, id):
|
||||
return {'id': 1, 'properties': {'kernel_id': 1, 'ramdisk_id': 1,
|
||||
|
||||
@@ -65,8 +65,8 @@ class CloudTestCase(test.TestCase):
|
||||
self.manager = manager.AuthManager()
|
||||
self.user = self.manager.create_user('admin', 'admin', 'admin', True)
|
||||
self.project = self.manager.create_project('proj', 'admin', 'proj')
|
||||
self.context = context.RequestContext(user=self.user,
|
||||
project=self.project)
|
||||
self.context = context.RequestContext(user_id=self.user.id,
|
||||
project_id=self.project.id)
|
||||
host = self.network.host
|
||||
|
||||
def fake_show(meh, context, id):
|
||||
@@ -97,7 +97,7 @@ class CloudTestCase(test.TestCase):
|
||||
|
||||
def _create_key(self, name):
|
||||
# NOTE(vish): create depends on pool, so just call helper directly
|
||||
return cloud._gen_key(self.context, self.context.user.id, name)
|
||||
return cloud._gen_key(self.context, self.context.user_id, name)
|
||||
|
||||
def test_describe_regions(self):
|
||||
"""Makes sure describe regions runs without raising an exception"""
|
||||
@@ -936,7 +936,7 @@ class CloudTestCase(test.TestCase):
|
||||
key = RSA.load_key_string(private_key, callback=lambda: None)
|
||||
bio = BIO.MemoryBuffer()
|
||||
public_key = db.key_pair_get(self.context,
|
||||
self.context.user.id,
|
||||
self.context.user_id,
|
||||
'test')['public_key']
|
||||
key.save_pub_key_bio(bio)
|
||||
converted = crypto.ssl_pub_to_ssh_pub(bio.read())
|
||||
@@ -960,7 +960,7 @@ class CloudTestCase(test.TestCase):
|
||||
'mytestfprint')
|
||||
self.assertTrue(result1)
|
||||
keydata = db.key_pair_get(self.context,
|
||||
self.context.user.id,
|
||||
self.context.user_id,
|
||||
'testimportkey1')
|
||||
self.assertEqual('mytestpubkey', keydata['public_key'])
|
||||
self.assertEqual('mytestfprint', keydata['fingerprint'])
|
||||
@@ -977,7 +977,7 @@ class CloudTestCase(test.TestCase):
|
||||
dummypub)
|
||||
self.assertTrue(result2)
|
||||
keydata = db.key_pair_get(self.context,
|
||||
self.context.user.id,
|
||||
self.context.user_id,
|
||||
'testimportkey2')
|
||||
self.assertEqual(dummypub, keydata['public_key'])
|
||||
self.assertEqual(dummyfprint, keydata['fingerprint'])
|
||||
|
||||
@@ -429,8 +429,8 @@ class LibvirtConnTestCase(test.TestCase):
|
||||
self.assertEquals(parameters[1].get('value'), 'fake')
|
||||
|
||||
def _check_xml_and_container(self, instance):
|
||||
user_context = context.RequestContext(project=self.project,
|
||||
user=self.user)
|
||||
user_context = context.RequestContext(self.user.id,
|
||||
self.project.id)
|
||||
instance_ref = db.instance_create(user_context, instance)
|
||||
# Re-get the instance so it's bound to an actual session
|
||||
instance_ref = db.instance_get(user_context, instance_ref['id'])
|
||||
@@ -475,8 +475,7 @@ class LibvirtConnTestCase(test.TestCase):
|
||||
|
||||
def _check_xml_and_uri(self, instance, expect_ramdisk, expect_kernel,
|
||||
rescue=False):
|
||||
user_context = context.RequestContext(project=self.project,
|
||||
user=self.user)
|
||||
user_context = context.RequestContext(self.user.id, self.project.id)
|
||||
instance_ref = db.instance_create(user_context, instance)
|
||||
network_ref = db.project_get_networks(context.get_admin_context(),
|
||||
self.project.id)[0]
|
||||
@@ -1166,7 +1165,7 @@ class NWFilterTestCase(test.TestCase):
|
||||
self.user = self.manager.create_user('fake', 'fake', 'fake',
|
||||
admin=True)
|
||||
self.project = self.manager.create_project('fake', 'fake', 'fake')
|
||||
self.context = context.RequestContext(self.user, self.project)
|
||||
self.context = context.RequestContext(self.user.id, self.project.id)
|
||||
|
||||
self.fake_libvirt_connection = Mock()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user