Fix issues coming from oslo-incubator update
Logging was enabled while it shouldn't (probably a miss) and config options were not updated correctly as CONF is a global object. Closes-Bug: #1290365 Change-Id: I7293e943d15e6f908248b0573f1c9a1914235f04
This commit is contained in:
parent
7ae8eeda35
commit
0ea24438d3
@ -13,15 +13,14 @@
|
|||||||
# See the License for the specific language governing permissions and
|
# See the License for the specific language governing permissions and
|
||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
|
|
||||||
|
|
||||||
import tempfile
|
import tempfile
|
||||||
|
|
||||||
import fixtures
|
import fixtures
|
||||||
|
from oslo.config import cfg
|
||||||
|
|
||||||
from climate import context
|
from climate import context
|
||||||
from climate.db.sqlalchemy import api as db_api
|
from climate.db.sqlalchemy import api as db_api
|
||||||
from climate.db.sqlalchemy import facade_wrapper
|
from climate.db.sqlalchemy import facade_wrapper
|
||||||
from climate.openstack.common.db import options as db_options
|
|
||||||
from climate.openstack.common import fileutils
|
from climate.openstack.common import fileutils
|
||||||
from climate.openstack.common.fixture import config
|
from climate.openstack.common.fixture import config
|
||||||
from climate.openstack.common.fixture import mockpatch
|
from climate.openstack.common.fixture import mockpatch
|
||||||
@ -30,6 +29,7 @@ from climate.openstack.common import policy as common_policy
|
|||||||
from climate.openstack.common import test
|
from climate.openstack.common import test
|
||||||
from climate.tests import fake_policy
|
from climate.tests import fake_policy
|
||||||
|
|
||||||
|
cfg.CONF.set_override('use_stderr', False)
|
||||||
|
|
||||||
logging.setup('climate')
|
logging.setup('climate')
|
||||||
_DB_CACHE = None
|
_DB_CACHE = None
|
||||||
@ -43,8 +43,8 @@ class Database(fixtures.Fixture):
|
|||||||
fd = tempfile.NamedTemporaryFile(delete=False)
|
fd = tempfile.NamedTemporaryFile(delete=False)
|
||||||
self.db_path = fd.name
|
self.db_path = fd.name
|
||||||
database_connection = 'sqlite:///' + self.db_path
|
database_connection = 'sqlite:///' + self.db_path
|
||||||
db_options.CONF.set_override('connection', str(database_connection),
|
cfg.CONF.set_override('connection', str(database_connection),
|
||||||
group='database')
|
group='database')
|
||||||
facade_wrapper._clear_engine()
|
facade_wrapper._clear_engine()
|
||||||
self.engine = facade_wrapper.get_engine()
|
self.engine = facade_wrapper.get_engine()
|
||||||
|
|
||||||
@ -70,7 +70,7 @@ class TestCase(test.BaseTestCase):
|
|||||||
self.read_cached_file.return_value = (True, fake_policy.policy_data)
|
self.read_cached_file.return_value = (True, fake_policy.policy_data)
|
||||||
self.common_policy = common_policy
|
self.common_policy = common_policy
|
||||||
self.patch(self.common_policy.Enforcer, '_get_policy_path')
|
self.patch(self.common_policy.Enforcer, '_get_policy_path')
|
||||||
db_options.CONF.set_override('policy_file', 'fake')
|
cfg.CONF.set_override('policy_file', 'fake')
|
||||||
|
|
||||||
def patch(self, obj, attr):
|
def patch(self, obj, attr):
|
||||||
"""Returns a Mocked object on the patched attribute."""
|
"""Returns a Mocked object on the patched attribute."""
|
||||||
|
Loading…
Reference in New Issue
Block a user