Enable oslo.i18n for oslo.vmware
Change-Id: Ie6c8406bf55a4fb96373cdd3e1a2f5b3c2aafe59
This commit is contained in:
parent
48847a5857
commit
5571e9f435
1
doc/source/history.rst
Normal file
1
doc/source/history.rst
Normal file
@ -0,0 +1 @@
|
|||||||
|
.. include:: ../../ChangeLog
|
@ -10,6 +10,7 @@ Contents:
|
|||||||
installation
|
installation
|
||||||
usage
|
usage
|
||||||
contributing
|
contributing
|
||||||
|
history
|
||||||
|
|
||||||
Code Documentation
|
Code Documentation
|
||||||
==================
|
==================
|
||||||
|
@ -2,7 +2,6 @@
|
|||||||
|
|
||||||
# The list of modules to copy from oslo-incubator.git
|
# The list of modules to copy from oslo-incubator.git
|
||||||
module=excutils
|
module=excutils
|
||||||
module=gettextutils
|
|
||||||
module=units
|
module=units
|
||||||
|
|
||||||
script=tools/run_cross_tests.sh
|
script=tools/run_cross_tests.sh
|
||||||
|
35
oslo/vmware/_i18n.py
Normal file
35
oslo/vmware/_i18n.py
Normal file
@ -0,0 +1,35 @@
|
|||||||
|
# Licensed under the Apache License, Version 2.0 (the "License"); you may
|
||||||
|
# not use this file except in compliance with the License. You may obtain
|
||||||
|
# a copy of the License at
|
||||||
|
#
|
||||||
|
# http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
#
|
||||||
|
# Unless required by applicable law or agreed to in writing, software
|
||||||
|
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||||
|
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||||
|
# License for the specific language governing permissions and limitations
|
||||||
|
# under the License.
|
||||||
|
|
||||||
|
"""oslo.i18n integration module.
|
||||||
|
|
||||||
|
See http://docs.openstack.org/developer/oslo.i18n/usage.html
|
||||||
|
|
||||||
|
"""
|
||||||
|
|
||||||
|
from oslo import i18n
|
||||||
|
|
||||||
|
|
||||||
|
_translators = i18n.TranslatorFactory(domain='oslo.vmware')
|
||||||
|
|
||||||
|
# The primary translation function using the well-known name "_"
|
||||||
|
_ = _translators.primary
|
||||||
|
|
||||||
|
# Translators for log levels.
|
||||||
|
#
|
||||||
|
# The abbreviated names are meant to reflect the usual use of a short
|
||||||
|
# name like '_'. The "L" is for "log" and the other letter comes from
|
||||||
|
# the level.
|
||||||
|
_LI = _translators.log_info
|
||||||
|
_LW = _translators.log_warning
|
||||||
|
_LE = _translators.log_error
|
||||||
|
_LC = _translators.log_critical
|
@ -25,10 +25,10 @@ import logging
|
|||||||
|
|
||||||
import six
|
import six
|
||||||
|
|
||||||
|
from oslo.vmware._i18n import _, _LE, _LI, _LW
|
||||||
from oslo.vmware.common import loopingcall
|
from oslo.vmware.common import loopingcall
|
||||||
from oslo.vmware import exceptions
|
from oslo.vmware import exceptions
|
||||||
from oslo.vmware.openstack.common import excutils
|
from oslo.vmware.openstack.common import excutils
|
||||||
from oslo.vmware.openstack.common.gettextutils import _, _LE, _LI, _LW
|
|
||||||
from oslo.vmware import pbm
|
from oslo.vmware import pbm
|
||||||
from oslo.vmware import vim
|
from oslo.vmware import vim
|
||||||
from oslo.vmware import vim_util
|
from oslo.vmware import vim_util
|
||||||
|
@ -21,7 +21,7 @@ import sys
|
|||||||
from eventlet import event
|
from eventlet import event
|
||||||
from eventlet import greenthread
|
from eventlet import greenthread
|
||||||
|
|
||||||
from oslo.vmware.openstack.common.gettextutils import _LE, _LW
|
from oslo.vmware._i18n import _LE, _LW
|
||||||
from oslo.vmware.openstack.common import timeutils
|
from oslo.vmware.openstack.common import timeutils
|
||||||
|
|
||||||
LOG = logging.getLogger(__name__)
|
LOG = logging.getLogger(__name__)
|
||||||
|
@ -21,7 +21,7 @@ import logging
|
|||||||
|
|
||||||
import six
|
import six
|
||||||
|
|
||||||
from oslo.vmware.openstack.common.gettextutils import _, _LE
|
from oslo.vmware._i18n import _, _LE
|
||||||
|
|
||||||
LOG = logging.getLogger(__name__)
|
LOG = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
@ -25,8 +25,8 @@ from eventlet import greenthread
|
|||||||
from eventlet import queue
|
from eventlet import queue
|
||||||
from eventlet import timeout
|
from eventlet import timeout
|
||||||
|
|
||||||
|
from oslo.vmware._i18n import _
|
||||||
from oslo.vmware import exceptions
|
from oslo.vmware import exceptions
|
||||||
from oslo.vmware.openstack.common.gettextutils import _
|
|
||||||
from oslo.vmware import rw_handles
|
from oslo.vmware import rw_handles
|
||||||
|
|
||||||
|
|
||||||
|
@ -16,7 +16,7 @@ import posixpath
|
|||||||
|
|
||||||
import six.moves.urllib.parse as urlparse
|
import six.moves.urllib.parse as urlparse
|
||||||
|
|
||||||
from oslo.vmware.openstack.common.gettextutils import _
|
from oslo.vmware._i18n import _
|
||||||
from oslo.vmware import vim_util
|
from oslo.vmware import vim_util
|
||||||
|
|
||||||
|
|
||||||
|
@ -27,7 +27,7 @@ import urlparse
|
|||||||
|
|
||||||
import suds.sax.element as element
|
import suds.sax.element as element
|
||||||
|
|
||||||
from oslo.vmware.openstack.common.gettextutils import _LW
|
from oslo.vmware._i18n import _LW
|
||||||
from oslo.vmware import service
|
from oslo.vmware import service
|
||||||
from oslo.vmware import vim_util
|
from oslo.vmware import vim_util
|
||||||
|
|
||||||
|
@ -30,9 +30,9 @@ import urlparse
|
|||||||
|
|
||||||
import netaddr
|
import netaddr
|
||||||
|
|
||||||
|
from oslo.vmware._i18n import _, _LE, _LW
|
||||||
from oslo.vmware import exceptions
|
from oslo.vmware import exceptions
|
||||||
from oslo.vmware.openstack.common import excutils
|
from oslo.vmware.openstack.common import excutils
|
||||||
from oslo.vmware.openstack.common.gettextutils import _, _LE, _LW
|
|
||||||
from oslo.vmware import vim_util
|
from oslo.vmware import vim_util
|
||||||
|
|
||||||
|
|
||||||
|
@ -25,8 +25,8 @@ import netaddr
|
|||||||
import six
|
import six
|
||||||
import suds
|
import suds
|
||||||
|
|
||||||
|
from oslo.vmware._i18n import _
|
||||||
from oslo.vmware import exceptions
|
from oslo.vmware import exceptions
|
||||||
from oslo.vmware.openstack.common.gettextutils import _
|
|
||||||
from oslo.vmware import vim_util
|
from oslo.vmware import vim_util
|
||||||
|
|
||||||
|
|
||||||
|
@ -11,7 +11,7 @@ iso8601>=0.1.9
|
|||||||
# for jsonutils
|
# for jsonutils
|
||||||
six>=1.7.0
|
six>=1.7.0
|
||||||
|
|
||||||
# used by openstack/common/gettextutils.py
|
oslo.i18n>=0.3.0
|
||||||
Babel>=1.3
|
Babel>=1.3
|
||||||
|
|
||||||
# for the routing notifier
|
# for the routing notifier
|
||||||
|
@ -155,9 +155,7 @@ class PBMUtilityTest(base.TestCase):
|
|||||||
self.assertIsNone(wsdl)
|
self.assertIsNone(wsdl)
|
||||||
|
|
||||||
def expected_wsdl(version):
|
def expected_wsdl(version):
|
||||||
driver_dir = os.path.join(os.path.dirname(__file__), '..',
|
driver_abs_dir = os.path.abspath(os.path.dirname(pbm.__file__))
|
||||||
'oslo', 'vmware')
|
|
||||||
driver_abs_dir = os.path.abspath(driver_dir)
|
|
||||||
path = os.path.join(driver_abs_dir, 'wsdl', version,
|
path = os.path.join(driver_abs_dir, 'wsdl', version,
|
||||||
'pbmService.wsdl')
|
'pbmService.wsdl')
|
||||||
return urlparse.urljoin('file:', urllib.pathname2url(path))
|
return urlparse.urljoin('file:', urllib.pathname2url(path))
|
||||||
|
4
tox.ini
4
tox.ini
@ -1,5 +1,4 @@
|
|||||||
[tox]
|
[tox]
|
||||||
skipsdist = True
|
|
||||||
envlist = py26,py27,py33,py34,pep8
|
envlist = py26,py27,py33,py34,pep8
|
||||||
|
|
||||||
[testenv]
|
[testenv]
|
||||||
@ -7,7 +6,6 @@ setenv = VIRTUAL_ENV={envdir}
|
|||||||
deps = -r{toxinidir}/requirements.txt
|
deps = -r{toxinidir}/requirements.txt
|
||||||
-r{toxinidir}/test-requirements.txt
|
-r{toxinidir}/test-requirements.txt
|
||||||
commands = python setup.py testr --slowest --testr-args='{posargs}'
|
commands = python setup.py testr --slowest --testr-args='{posargs}'
|
||||||
usedevelop = True
|
|
||||||
|
|
||||||
[testenv:pep8]
|
[testenv:pep8]
|
||||||
commands = flake8
|
commands = flake8
|
||||||
@ -33,4 +31,4 @@ exclude=.venv,.git,.tox,dist,doc,*openstack/common*,*lib/python*,*egg,build,__in
|
|||||||
builtins = _
|
builtins = _
|
||||||
|
|
||||||
[hacking]
|
[hacking]
|
||||||
import_exceptions = oslo.vmware.openstack.common.gettextutils
|
import_exceptions = oslo.vmware._i18n
|
||||||
|
Loading…
x
Reference in New Issue
Block a user