Browse Source

Port to use oslo.i18n

Module gettextutils from oslo-incubator was graduated to separate
library (oslo.i18n) and removed from repository, so we should use
new library.

Change-Id: I15d36ac5a2bb88b332ffa38d29488b75c55a20a9
changes/61/127961/3
Andrey Kurilin 8 years ago
parent
commit
dc09cf27e3
  1. 2
      novaclient/client.py
  2. 35
      novaclient/i18n.py
  3. 2
      novaclient/shell.py
  4. 2
      novaclient/utils.py
  5. 3
      novaclient/v1_1/contrib/baremetal.py
  6. 2
      novaclient/v1_1/contrib/cells.py
  7. 2
      novaclient/v1_1/contrib/host_evacuate.py
  8. 2
      novaclient/v1_1/contrib/host_evacuate_live.py
  9. 2
      novaclient/v1_1/contrib/host_servers_migrate.py
  10. 2
      novaclient/v1_1/contrib/instance_action.py
  11. 2
      novaclient/v1_1/contrib/metadata_extensions.py
  12. 2
      novaclient/v1_1/contrib/migrations.py
  13. 2
      novaclient/v1_1/contrib/tenant_networks.py
  14. 2
      novaclient/v1_1/flavor_access.py
  15. 2
      novaclient/v1_1/flavors.py
  16. 2
      novaclient/v1_1/networks.py
  17. 2
      novaclient/v1_1/security_group_default_rules.py
  18. 2
      novaclient/v1_1/security_group_rules.py
  19. 2
      novaclient/v1_1/servers.py
  20. 2
      novaclient/v1_1/shell.py
  21. 3
      novaclient/v3/servers.py
  22. 2
      novaclient/v3/shell.py
  23. 1
      openstack-common.conf
  24. 1
      requirements.txt
  25. 2
      tox.ini

2
novaclient/client.py

@ -44,7 +44,7 @@ except ImportError:
from six.moves.urllib import parse
from novaclient import exceptions
from novaclient.openstack.common.gettextutils import _
from novaclient.i18n import _
from novaclient import service_catalog
from novaclient import utils

35
novaclient/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 for novaclient.
See http://docs.openstack.org/developer/oslo.i18n/usage.html .
"""
from oslo import i18n
_translators = i18n.TranslatorFactory(domain='novaclient')
# 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

2
novaclient/shell.py

@ -47,8 +47,8 @@ import novaclient.auth_plugin
from novaclient import client
from novaclient import exceptions as exc
import novaclient.extension
from novaclient.i18n import _
from novaclient.openstack.common import cliutils
from novaclient.openstack.common.gettextutils import _
from novaclient import utils
from novaclient.v1_1 import shell as shell_v1_1
from novaclient.v3 import shell as shell_v3

2
novaclient/utils.py

@ -23,8 +23,8 @@ import prettytable
import six
from novaclient import exceptions
from novaclient.i18n import _
from novaclient.openstack.common import cliutils
from novaclient.openstack.common.gettextutils import _
arg = cliutils.arg

3
novaclient/v1_1/contrib/baremetal.py

@ -16,8 +16,9 @@
"""
Baremetal interface (v2 extension).
"""
from novaclient import base
from novaclient.openstack.common.gettextutils import _
from novaclient.i18n import _
from novaclient import utils

2
novaclient/v1_1/contrib/cells.py

@ -14,7 +14,7 @@
# under the License.
from novaclient import base
from novaclient.openstack.common.gettextutils import _
from novaclient.i18n import _
from novaclient import utils

2
novaclient/v1_1/contrib/host_evacuate.py

@ -14,7 +14,7 @@
# under the License.
from novaclient import base
from novaclient.openstack.common.gettextutils import _
from novaclient.i18n import _
from novaclient import utils

2
novaclient/v1_1/contrib/host_evacuate_live.py

@ -13,7 +13,7 @@
# License for the specific language governing permissions and limitations
# under the License.
from novaclient.openstack.common.gettextutils import _
from novaclient.i18n import _
from novaclient import utils

2
novaclient/v1_1/contrib/host_servers_migrate.py

@ -14,7 +14,7 @@
# under the License.
from novaclient import base
from novaclient.openstack.common.gettextutils import _
from novaclient.i18n import _
from novaclient import utils

2
novaclient/v1_1/contrib/instance_action.py

@ -16,7 +16,7 @@
import pprint
from novaclient import base
from novaclient.openstack.common.gettextutils import _
from novaclient.i18n import _
from novaclient import utils

2
novaclient/v1_1/contrib/metadata_extensions.py

@ -13,7 +13,7 @@
# License for the specific language governing permissions and limitations
# under the License.
from novaclient.openstack.common.gettextutils import _
from novaclient.i18n import _
from novaclient import utils
from novaclient.v1_1 import shell

2
novaclient/v1_1/contrib/migrations.py

@ -17,7 +17,7 @@ migration interface
from six.moves.urllib import parse
from novaclient import base
from novaclient.openstack.common.gettextutils import _
from novaclient.i18n import _
from novaclient import utils

2
novaclient/v1_1/contrib/tenant_networks.py

@ -13,7 +13,7 @@
# limitations under the License.
from novaclient import base
from novaclient.openstack.common.gettextutils import _
from novaclient.i18n import _
from novaclient import utils

2
novaclient/v1_1/flavor_access.py

@ -16,7 +16,7 @@
"""Flavor access interface."""
from novaclient import base
from novaclient.openstack.common.gettextutils import _
from novaclient.i18n import _
class FlavorAccess(base.Resource):

2
novaclient/v1_1/flavors.py

@ -21,7 +21,7 @@ from six.moves.urllib import parse
from novaclient import base
from novaclient import exceptions
from novaclient.openstack.common.gettextutils import _
from novaclient.i18n import _
from novaclient import utils

2
novaclient/v1_1/networks.py

@ -19,7 +19,7 @@ Network interface.
from novaclient import base
from novaclient import exceptions
from novaclient.openstack.common.gettextutils import _
from novaclient.i18n import _
class Network(base.Resource):

2
novaclient/v1_1/security_group_default_rules.py

@ -16,7 +16,7 @@ Security group default rules interface.
from novaclient import base
from novaclient import exceptions
from novaclient.openstack.common.gettextutils import _
from novaclient.i18n import _
class SecurityGroupDefaultRule(base.Resource):

2
novaclient/v1_1/security_group_rules.py

@ -19,7 +19,7 @@ Security group rules interface (1.1 extension).
from novaclient import base
from novaclient import exceptions
from novaclient.openstack.common.gettextutils import _
from novaclient.i18n import _
class SecurityGroupRule(base.Resource):

2
novaclient/v1_1/servers.py

@ -27,7 +27,7 @@ from six.moves.urllib import parse
from novaclient import base
from novaclient import crypto
from novaclient.openstack.common.gettextutils import _
from novaclient.i18n import _
from novaclient.v1_1 import security_groups

2
novaclient/v1_1/shell.py

@ -34,8 +34,8 @@ from oslo.utils import timeutils
import six
from novaclient import exceptions
from novaclient.i18n import _
from novaclient.openstack.common import cliutils
from novaclient.openstack.common.gettextutils import _
from novaclient.openstack.common import uuidutils
from novaclient import utils
from novaclient.v1_1 import availability_zones

3
novaclient/v3/servers.py

@ -27,7 +27,8 @@ from six.moves.urllib import parse
from novaclient import base
from novaclient import crypto
from novaclient.openstack.common.gettextutils import _
from novaclient.i18n import _
REBOOT_SOFT, REBOOT_HARD = 'SOFT', 'HARD'

2
novaclient/v3/shell.py

@ -32,8 +32,8 @@ from oslo.utils import timeutils
import six
from novaclient import exceptions
from novaclient.i18n import _
from novaclient.openstack.common import cliutils
from novaclient.openstack.common.gettextutils import _
from novaclient.openstack.common import uuidutils
from novaclient import utils
from novaclient.v3 import availability_zones

1
openstack-common.conf

@ -3,7 +3,6 @@
# The list of modules to copy from oslo-incubator
module=apiclient
module=cliutils
module=gettextutils
module=install_venv_common
module=uuidutils

1
requirements.txt

@ -4,6 +4,7 @@
pbr>=0.6,!=0.7,<1.0
argparse
iso8601>=0.1.9
oslo.i18n>=1.0.0 # Apache-2.0
oslo.serialization>=1.0.0 # Apache-2.0
oslo.utils>=1.0.0 # Apache-2.0
PrettyTable>=0.7,<0.8

2
tox.ini

@ -48,4 +48,4 @@ show-source = True
exclude=.venv,.git,.tox,dist,*openstack/common*,*lib/python*,*egg,build,doc/source/conf.py
[hacking]
import_exceptions = novaclient.openstack.common.gettextutils
import_exceptions = novaclient.i18n

Loading…
Cancel
Save