Change oslo.config to oslo_config

The oslo.* libraries are moving away from namespace packages.

A hacking check is added to enforce use of the new location.

bp drop-namespace-packages

Change-Id: Ic0d4053875da0628f2359c109f2779d12aadc3eb
This commit is contained in:
Brant Knudson 2015-01-06 09:34:48 -06:00
parent d7266cb4d7
commit fe50dbe9e9
12 changed files with 27 additions and 15 deletions

View File

@ -16,7 +16,7 @@ from __future__ import absolute_import
import os
from oslo.config import cfg
from oslo_config import cfg
import pbr.version
from keystone import assignment

View File

@ -12,7 +12,7 @@
# License for the specific language governing permissions and limitations
# under the License.
from oslo.config import cfg
from oslo_config import cfg
import oslo_messaging
@ -1010,9 +1010,9 @@ def configure(conf=None):
def list_opts():
"""Return a list of oslo.config options available in Keystone.
"""Return a list of oslo_config options available in Keystone.
The returned list includes all oslo.config options which are registered as
The returned list includes all oslo_config options which are registered as
the "FILE_OPTIONS" in keystone.common.config. This list will not include
the options from the oslo-incubator library or any options registered
dynamically at run time.
@ -1022,7 +1022,7 @@ def list_opts():
second element will be registered. A group name of None corresponds to the
[DEFAULT] group in config files.
This function is also discoverable via the 'oslo.config.opts' entry point
This function is also discoverable via the 'oslo_config.opts' entry point
under the 'keystone.config.opts' namespace.
The purpose of this is to allow tools like the Oslo sample config file

View File

@ -21,7 +21,7 @@ CONF() because it sets up configuration options.
import contextlib
import functools
from oslo.config import cfg
from oslo_config import cfg
from oslo_db import exception as db_exception
from oslo_db import options as db_options
from oslo_db.sqlalchemy import models

View File

@ -10,7 +10,7 @@
# License for the specific language governing permissions and limitations
# under the License.
from oslo.config import cfg
from oslo_config import cfg
import webob
from keystone.common import controller

View File

@ -400,9 +400,9 @@ class CheckForLoggingIssues(BaseASTChecker):
def check_oslo_namespace_imports(logical_line, blank_before, filename):
oslo_namespace_imports = re.compile(
r"(((from)|(import))\s+oslo\.("
"(db)|(messaging)|(serialization)|(utils)))|"
"(config)|(db)|(messaging)|(serialization)|(utils)))|"
"(from\s+oslo\s+import\s+("
"(db)|(messaging)|(serialization)|(utils)))")
"(config)|(db)|(messaging)|(serialization)|(utils)))")
if re.match(oslo_namespace_imports, logical_line):
msg = ("K333: '%s' must be used instead of '%s'.") % (

View File

@ -19,7 +19,7 @@ import functools
import os
import uuid
from oslo.config import cfg
from oslo_config import cfg
from oslo_utils import importutils
import six

View File

@ -19,7 +19,7 @@ import inspect
import logging
import socket
from oslo.config import cfg
from oslo_config import cfg
import oslo_messaging
import pycadf
from pycadf import cadftaxonomy as taxonomy

View File

@ -26,7 +26,7 @@ import time
import warnings
import fixtures
from oslo.config import fixture as config_fixture
from oslo_config import fixture as config_fixture
import oslotest.base as oslotest
from oslotest import mockpatch
import six

View File

@ -212,6 +212,14 @@ class HackingCode(fixtures.Fixture):
from oslo import db
from oslo.db import api
from oslo_db import api
import oslo.config
import oslo_config
import oslo.config.cfg
import oslo_config.cfg
from oslo import config
from oslo.config import cfg
from oslo_config import cfg
""",
'expected_errors': [
(1, 0, 'K333'),
@ -230,6 +238,10 @@ class HackingCode(fixtures.Fixture):
(27, 0, 'K333'),
(29, 0, 'K333'),
(30, 0, 'K333'),
(33, 0, 'K333'),
(35, 0, 'K333'),
(37, 0, 'K333'),
(38, 0, 'K333'),
],
}

View File

@ -12,7 +12,7 @@
import uuid
from oslo.config import cfg
from oslo_config import cfg
from keystone.common import controller
from keystone import exception

View File

@ -14,7 +14,7 @@
import uuid
from oslo.config import cfg
from oslo_config import cfg
from testtools import matchers
from keystone.common import controller

View File

@ -16,7 +16,7 @@ import logging
import uuid
import mock
from oslo.config import cfg
from oslo_config import cfg
from oslotest import mockpatch
from pycadf import cadftaxonomy
from pycadf import cadftype