diff --git a/doc/source/history.rst b/doc/source/history.rst new file mode 100644 index 0000000..69ed4fe --- /dev/null +++ b/doc/source/history.rst @@ -0,0 +1 @@ +.. include:: ../../ChangeLog diff --git a/doc/source/index.rst b/doc/source/index.rst index a120c1a..65a7168 100644 --- a/doc/source/index.rst +++ b/doc/source/index.rst @@ -10,6 +10,7 @@ Contents: installation usage contributing + history Code Documentation ================== diff --git a/openstack-common.conf b/openstack-common.conf index e229456..ad06ac2 100644 --- a/openstack-common.conf +++ b/openstack-common.conf @@ -2,7 +2,6 @@ # The list of modules to copy from oslo-incubator.git module=excutils -module=gettextutils module=units script=tools/run_cross_tests.sh diff --git a/oslo/vmware/_i18n.py b/oslo/vmware/_i18n.py new file mode 100644 index 0000000..5ab76c8 --- /dev/null +++ b/oslo/vmware/_i18n.py @@ -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 diff --git a/oslo/vmware/api.py b/oslo/vmware/api.py index 65fe903..5e65786 100644 --- a/oslo/vmware/api.py +++ b/oslo/vmware/api.py @@ -25,10 +25,10 @@ import logging import six +from oslo.vmware._i18n import _, _LE, _LI, _LW from oslo.vmware.common import loopingcall from oslo.vmware import exceptions 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 vim from oslo.vmware import vim_util diff --git a/oslo/vmware/common/loopingcall.py b/oslo/vmware/common/loopingcall.py index 92df9ce..891eb8e 100644 --- a/oslo/vmware/common/loopingcall.py +++ b/oslo/vmware/common/loopingcall.py @@ -21,7 +21,7 @@ import sys from eventlet import event 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 LOG = logging.getLogger(__name__) diff --git a/oslo/vmware/exceptions.py b/oslo/vmware/exceptions.py index 8622c0f..133fbed 100644 --- a/oslo/vmware/exceptions.py +++ b/oslo/vmware/exceptions.py @@ -21,7 +21,7 @@ import logging import six -from oslo.vmware.openstack.common.gettextutils import _, _LE +from oslo.vmware._i18n import _, _LE LOG = logging.getLogger(__name__) diff --git a/oslo/vmware/image_transfer.py b/oslo/vmware/image_transfer.py index 1c2f58b..1e83874 100644 --- a/oslo/vmware/image_transfer.py +++ b/oslo/vmware/image_transfer.py @@ -25,8 +25,8 @@ from eventlet import greenthread from eventlet import queue from eventlet import timeout +from oslo.vmware._i18n import _ from oslo.vmware import exceptions -from oslo.vmware.openstack.common.gettextutils import _ from oslo.vmware import rw_handles diff --git a/oslo/vmware/objects/datastore.py b/oslo/vmware/objects/datastore.py index 73466fb..1453ada 100644 --- a/oslo/vmware/objects/datastore.py +++ b/oslo/vmware/objects/datastore.py @@ -16,7 +16,7 @@ import posixpath 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 diff --git a/oslo/vmware/pbm.py b/oslo/vmware/pbm.py index 35da580..46c9784 100644 --- a/oslo/vmware/pbm.py +++ b/oslo/vmware/pbm.py @@ -27,7 +27,7 @@ import urlparse 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 vim_util diff --git a/oslo/vmware/rw_handles.py b/oslo/vmware/rw_handles.py index e2f3358..5c93035 100644 --- a/oslo/vmware/rw_handles.py +++ b/oslo/vmware/rw_handles.py @@ -30,9 +30,9 @@ import urlparse import netaddr +from oslo.vmware._i18n import _, _LE, _LW from oslo.vmware import exceptions from oslo.vmware.openstack.common import excutils -from oslo.vmware.openstack.common.gettextutils import _, _LE, _LW from oslo.vmware import vim_util diff --git a/oslo/vmware/service.py b/oslo/vmware/service.py index 6ab945c..3b7583f 100644 --- a/oslo/vmware/service.py +++ b/oslo/vmware/service.py @@ -25,8 +25,8 @@ import netaddr import six import suds +from oslo.vmware._i18n import _ from oslo.vmware import exceptions -from oslo.vmware.openstack.common.gettextutils import _ from oslo.vmware import vim_util diff --git a/requirements.txt b/requirements.txt index 7f36a22..57d2aef 100644 --- a/requirements.txt +++ b/requirements.txt @@ -11,7 +11,7 @@ iso8601>=0.1.9 # for jsonutils six>=1.7.0 -# used by openstack/common/gettextutils.py +oslo.i18n>=0.3.0 Babel>=1.3 # for the routing notifier diff --git a/tests/test_pbm.py b/tests/test_pbm.py index 85b3ef1..10eccb9 100644 --- a/tests/test_pbm.py +++ b/tests/test_pbm.py @@ -155,9 +155,7 @@ class PBMUtilityTest(base.TestCase): self.assertIsNone(wsdl) def expected_wsdl(version): - driver_dir = os.path.join(os.path.dirname(__file__), '..', - 'oslo', 'vmware') - driver_abs_dir = os.path.abspath(driver_dir) + driver_abs_dir = os.path.abspath(os.path.dirname(pbm.__file__)) path = os.path.join(driver_abs_dir, 'wsdl', version, 'pbmService.wsdl') return urlparse.urljoin('file:', urllib.pathname2url(path)) diff --git a/tox.ini b/tox.ini index 74877dc..5d92b30 100644 --- a/tox.ini +++ b/tox.ini @@ -1,5 +1,4 @@ [tox] -skipsdist = True envlist = py26,py27,py33,py34,pep8 [testenv] @@ -7,7 +6,6 @@ setenv = VIRTUAL_ENV={envdir} deps = -r{toxinidir}/requirements.txt -r{toxinidir}/test-requirements.txt commands = python setup.py testr --slowest --testr-args='{posargs}' -usedevelop = True [testenv:pep8] commands = flake8 @@ -33,4 +31,4 @@ exclude=.venv,.git,.tox,dist,doc,*openstack/common*,*lib/python*,*egg,build,__in builtins = _ [hacking] -import_exceptions = oslo.vmware.openstack.common.gettextutils +import_exceptions = oslo.vmware._i18n