diff --git a/etc/trove/trove-taskmanager.conf.sample b/etc/trove/trove-taskmanager.conf.sample index c0c6551cb8..12a48a16ad 100644 --- a/etc/trove/trove-taskmanager.conf.sample +++ b/etc/trove/trove-taskmanager.conf.sample @@ -97,7 +97,7 @@ use_nova_server_config_drive = False # basically acting like the client via that proxy token. nova_proxy_admin_user = admin nova_proxy_admin_pass = 3de4922d8b6ac5a1aad9 -nova_proxy_admin_tenant_name = admin +nova_proxy_admin_tenant_id = # Manager impl for the taskmanager taskmanager_manager=trove.taskmanager.manager.Manager diff --git a/etc/trove/trove.conf.test b/etc/trove/trove.conf.test index 2c92be904d..286d07ca0c 100644 --- a/etc/trove/trove.conf.test +++ b/etc/trove/trove.conf.test @@ -53,7 +53,7 @@ db_api_implementation = trove.db.sqlalchemy.api # basically acting like the client via that proxy token. nova_proxy_admin_user = admin nova_proxy_admin_pass = 3de4922d8b6ac5a1aad9 -nova_proxy_admin_tenant_name = admin +nova_proxy_admin_tenant_id = trove_auth_url = http://0.0.0.0:5000/v2.0 nova_region_name = RegionOne diff --git a/trove/common/cfg.py b/trove/common/cfg.py index 62d4124282..4ec93f9bf7 100644 --- a/trove/common/cfg.py +++ b/trove/common/cfg.py @@ -325,8 +325,9 @@ common_opts = [ help="Admin username used to connect to Nova.", secret=True), cfg.StrOpt('nova_proxy_admin_pass', default='', help="Admin password used to connect to Nova.", secret=True), - cfg.StrOpt('nova_proxy_admin_tenant_name', default='', - help="Admin tenant used to connect to Nova.", secret=True), + cfg.StrOpt('nova_proxy_admin_tenant_id', default='', + deprecated_name='nova_proxy_admin_tenant_name', + help="Admin tenant ID used to connect to Nova.", secret=True), cfg.StrOpt('network_label_regex', default='^private$', help='Regular expression to match Trove network labels.'), cfg.StrOpt('ip_regex', default=None, diff --git a/trove/taskmanager/manager.py b/trove/taskmanager/manager.py index 242f9f765b..d4b634d44a 100644 --- a/trove/taskmanager/manager.py +++ b/trove/taskmanager/manager.py @@ -48,7 +48,7 @@ class Manager(periodic_task.PeriodicTasks): self.admin_context = TroveContext( user=CONF.nova_proxy_admin_user, auth_token=CONF.nova_proxy_admin_pass, - tenant=CONF.nova_proxy_admin_tenant_name) + tenant=CONF.nova_proxy_admin_tenant_id) if CONF.exists_notification_transformer: self.exists_transformer = importutils.import_object( CONF.exists_notification_transformer, diff --git a/trove/tests/unittests/common/test_remote.py b/trove/tests/unittests/common/test_remote.py index a5a5512a5c..1d05da5b07 100644 --- a/trove/tests/unittests/common/test_remote.py +++ b/trove/tests/unittests/common/test_remote.py @@ -21,6 +21,7 @@ import testtools from testtools import matchers import swiftclient.client +import uuid from trove.tests.fakes.swift import SwiftClientStub from trove.common.context import TroveContext @@ -49,7 +50,7 @@ class TestRemote(testtools.TestCase): 'publicURL': 'example.com'}], 'type': 'object-store'}] client = remote.create_swift_client(TroveContext( - tenant='123', + tenant=uuid.uuid4().hex, service_catalog=service_catalog)) headers, container = client.get_container('bob') self.assertIs(headers, "text") @@ -287,7 +288,7 @@ class TestCreateCinderClient(testtools.TestCase): def test_create_with_conf_override(self): cinder_url_from_conf = 'http://example.com' - tenant_from_ctx = 'abc' + tenant_from_ctx = uuid.uuid4().hex cfg.CONF.set_override('cinder_url', cinder_url_from_conf) client = remote.create_cinder_client( @@ -297,7 +298,7 @@ class TestCreateCinderClient(testtools.TestCase): def test_create_with_conf_override_trailing_slash(self): cinder_url_from_conf = 'http://example.com/' - tenant_from_ctx = 'abc' + tenant_from_ctx = uuid.uuid4().hex cfg.CONF.set_override('cinder_url', cinder_url_from_conf) client = remote.create_cinder_client( TroveContext(tenant=tenant_from_ctx)) @@ -362,7 +363,7 @@ class TestCreateNovaClient(testtools.TestCase): def test_create_with_conf_override(self): nova_url_from_conf = 'http://example.com' - tenant_from_ctx = 'abc' + tenant_from_ctx = uuid.uuid4().hex cfg.CONF.set_override('nova_compute_url', nova_url_from_conf) client = remote.create_nova_client( @@ -372,7 +373,7 @@ class TestCreateNovaClient(testtools.TestCase): def test_create_with_conf_override_trailing_slash(self): nova_url_from_conf = 'http://example.com/' - tenant_from_ctx = 'abc' + tenant_from_ctx = uuid.uuid4().hex cfg.CONF.set_override('nova_compute_url', nova_url_from_conf) client = remote.create_nova_client( TroveContext(tenant=tenant_from_ctx)) @@ -437,7 +438,7 @@ class TestCreateHeatClient(testtools.TestCase): def test_create_with_conf_override(self): heat_url_from_conf = 'http://example.com' - tenant_from_ctx = 'abc' + tenant_from_ctx = uuid.uuid4().hex cfg.CONF.set_override('heat_url', heat_url_from_conf) client = remote.create_heat_client( @@ -447,7 +448,7 @@ class TestCreateHeatClient(testtools.TestCase): def test_create_with_conf_override_trailing_slash(self): heat_url_from_conf = 'http://example.com/' - tenant_from_ctx = 'abc' + tenant_from_ctx = uuid.uuid4().hex cfg.CONF.set_override('heat_url', heat_url_from_conf) client = remote.create_heat_client( TroveContext(tenant=tenant_from_ctx)) @@ -512,7 +513,7 @@ class TestCreateSwiftClient(testtools.TestCase): def test_create_with_conf_override(self): swift_url_from_conf = 'http://example.com/AUTH_' - tenant_from_ctx = 'abc' + tenant_from_ctx = uuid.uuid4().hex cfg.CONF.set_override('swift_url', swift_url_from_conf) client = remote.create_swift_client(