Skip to content

Commit

Permalink
Don't apply config fixture to auth_token.CONF
Browse files Browse the repository at this point in the history
auth_token.CONF is simply the global oslo.config conf object linked into
the auth_token module. It is not intended for public use and has
recently been moved.

We can mock exactly the same entries without having to reach into
auth_token middleware and should do that instead.

Closes-Bug: #1600529
Change-Id: I5e8a481f37a7b409e491ce893a0e898d5085cc75
(cherry picked from commit 0bd4a6c)
Conflicts:
	cinder/tests/unit/api/contrib/test_quotas.py
  • Loading branch information
jamielennox authored and eharney committed Jul 11, 2016
1 parent 911456b commit cfa3056
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 7 deletions.
3 changes: 1 addition & 2 deletions cinder/tests/unit/api/contrib/test_quotas.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@
from cinder import test
from cinder.tests.unit import test_db_api

from keystonemiddleware import auth_token
from oslo_config import cfg
from oslo_config import fixture as config_fixture

Expand Down Expand Up @@ -114,7 +113,7 @@ def _list_projects(context):
self.addCleanup(list_patcher.stop)

self.auth_url = 'http://localhost:5000'
self.fixture = self.useFixture(config_fixture.Config(auth_token.CONF))
self.fixture = self.useFixture(config_fixture.Config(CONF))
self.fixture.config(auth_uri=self.auth_url, group='keystone_authtoken')

def _create_project_hierarchy(self):
Expand Down
4 changes: 1 addition & 3 deletions cinder/tests/unit/test_quota.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,6 @@
import cinder.tests.unit.image.fake
from cinder import volume

from keystonemiddleware import auth_token


CONF = cfg.CONF

Expand Down Expand Up @@ -1407,7 +1405,7 @@ def _keystone_mock(self):
keystone_patcher.start()
self.addCleanup(keystone_patcher.stop)

self.fixture = self.useFixture(config_fixture.Config(auth_token.CONF))
self.fixture = self.useFixture(config_fixture.Config(CONF))
self.fixture.config(auth_uri=self.auth_url, group='keystone_authtoken')
self.driver = quota.NestedDbQuotaDriver()

Expand Down
3 changes: 1 addition & 2 deletions cinder/tests/unit/test_quota_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
from cinder import test

from keystoneclient import exceptions
from keystonemiddleware import auth_token

from oslo_config import cfg
from oslo_config import fixture as config_fixture
Expand All @@ -43,7 +42,7 @@ def setUp(self):

self.auth_url = 'http://localhost:5000'
self.context = context.RequestContext('fake_user', 'fake_proj_id')
self.fixture = self.useFixture(config_fixture.Config(auth_token.CONF))
self.fixture = self.useFixture(config_fixture.Config(CONF))
self.fixture.config(auth_uri=self.auth_url, group='keystone_authtoken')

@mock.patch('keystoneclient.client.Client')
Expand Down

0 comments on commit cfa3056

Please sign in to comment.