Change oslo.i18n to oslo_i18n
The oslo libraries are moving away from namespace packages. bp drop-namespace-packages Change-Id: I5b6bb46ac55b8309845fcc8b01d93d97be4e86ca
This commit is contained in:
@@ -24,8 +24,9 @@ import re
|
||||
|
||||
def check_oslo_namespace_imports(logical_line, blank_before, filename):
|
||||
oslo_namespace_imports = re.compile(
|
||||
r"(((from)|(import))\s+oslo\.((config)|(serialization)|(utils)))|"
|
||||
"(from\s+oslo\s+import\s+((config)|(serialization)|(utils)))")
|
||||
r"(((from)|(import))\s+oslo\."
|
||||
"((config)|(serialization)|(utils)|(i18n)))|"
|
||||
"(from\s+oslo\s+import\s+((config)|(serialization)|(utils)|(i18n)))")
|
||||
|
||||
if re.match(oslo_namespace_imports, logical_line):
|
||||
msg = ("K333: '%s' must be used instead of '%s'.") % (
|
||||
|
||||
@@ -18,10 +18,10 @@ See http://docs.openstack.org/developer/oslo.i18n/usage.html .
|
||||
|
||||
"""
|
||||
|
||||
from oslo import i18n
|
||||
import oslo_i18n
|
||||
|
||||
|
||||
_translators = i18n.TranslatorFactory(domain='keystoneclient')
|
||||
_translators = oslo_i18n.TranslatorFactory(domain='keystoneclient')
|
||||
|
||||
# The primary translation function using the well-known name "_"
|
||||
_ = _translators.primary
|
||||
|
||||
Reference in New Issue
Block a user