Use oslo namespaces

Instead of using imports like:
  import oslo.config

we should be using:
  import oslo_config

Change-Id: I11fe1dbb0d638b9cc6d65fcdb1c1482cdf0c40b9
This commit is contained in:
Steve Martinelli 2015-02-04 01:42:07 -05:00
parent d0d6b3bd2e
commit ebd55395ce
8 changed files with 14 additions and 14 deletions

View File

@ -14,10 +14,10 @@
See http://docs.openstack.org/developer/oslo.i18n/usage.html
"""
from oslo import i18n
import oslo_i18n
_translators = i18n.TranslatorFactory(domain='pycadf')
_translators = oslo_i18n.TranslatorFactory(domain='pycadf')
# The primary translation function using the well-known name "_"
_ = _translators.primary

View File

@ -17,7 +17,7 @@ import collections
import os
import re
from oslo.config import cfg
from oslo_config import cfg
from six.moves import configparser
from six.moves.urllib import parse as urlparse

View File

@ -14,7 +14,7 @@
import abc
from oslo.serialization import jsonutils
from oslo_serialization import jsonutils
import six
CADF_SCHEMA_1_0_0 = 'cadf:'

View File

@ -14,7 +14,7 @@
import uuid
from oslo.config import cfg
from oslo_config import cfg
import six
CONF = cfg.CONF

View File

@ -18,8 +18,8 @@ import os.path
import sys
import traceback as tb
from oslo.config import cfg
import oslo.messaging
from oslo_config import cfg
import oslo_messaging
import six
import webob.dec
@ -76,8 +76,8 @@ class RequestNotifier(base.Middleware):
self.service_name = conf.get('service_name')
self.ignore_req_list = [x.upper().strip() for x in
conf.get('ignore_req_list', '').split(',')]
self.notifier = oslo.messaging.Notifier(
oslo.messaging.get_transport(cfg.CONF, aliases=TRANSPORT_ALIASES),
self.notifier = oslo_messaging.Notifier(
oslo_messaging.get_transport(cfg.CONF, aliases=TRANSPORT_ALIASES),
os.path.basename(sys.argv[0]))
super(RequestNotifier, self).__init__(app)

View File

@ -14,7 +14,7 @@
import uuid
from oslo.config import cfg
from oslo_config import cfg
import webob
from pycadf.audit import api

View File

@ -17,7 +17,7 @@
import os.path
import fixtures
from oslo.config import cfg
from oslo_config import cfg
from oslotest import moxstubout
import testtools

View File

@ -35,7 +35,7 @@ class FakeFailingApp(object):
raise Exception("It happens!")
@mock.patch('oslo.messaging.get_transport', mock.MagicMock())
@mock.patch('oslo_messaging.get_transport', mock.MagicMock())
class AuditMiddlewareTest(base.TestCase):
ENV_HEADERS = {'HTTP_X_SERVICE_CATALOG':
'''[{"endpoints_links": [],
@ -67,7 +67,7 @@ class AuditMiddlewareTest(base.TestCase):
self.ENV_HEADERS['REQUEST_METHOD'] = 'GET'
req = webob.Request.blank('/foo/bar',
environ=self.ENV_HEADERS)
with mock.patch('oslo.messaging.Notifier.info') as notify:
with mock.patch('oslo_messaging.Notifier.info') as notify:
middleware(req)
# Check first notification with only 'request'
call_args = notify.call_args_list[0][0]
@ -101,7 +101,7 @@ class AuditMiddlewareTest(base.TestCase):
self.ENV_HEADERS['REQUEST_METHOD'] = 'GET'
req = webob.Request.blank('/foo/bar',
environ=self.ENV_HEADERS)
with mock.patch('oslo.messaging.Notifier.info') as notify:
with mock.patch('oslo_messaging.Notifier.info') as notify:
try:
middleware(req)
self.fail("Application exception has not been re-raised")