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:
Sylvain Bauza 2014-03-10 14:52:35 +01:00
parent 7ae8eeda35
commit 0ea24438d3

View File

@ -13,15 +13,14 @@
# See the License for the specific language governing permissions and
# limitations under the License.
import tempfile
import fixtures
from oslo.config import cfg
from climate import context
from climate.db.sqlalchemy import api as db_api
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.fixture import config
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.tests import fake_policy
cfg.CONF.set_override('use_stderr', False)
logging.setup('climate')
_DB_CACHE = None
@ -43,7 +43,7 @@ class Database(fixtures.Fixture):
fd = tempfile.NamedTemporaryFile(delete=False)
self.db_path = fd.name
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')
facade_wrapper._clear_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.common_policy = common_policy
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):
"""Returns a Mocked object on the patched attribute."""