Skip to content

Commit

Permalink
Switch heat resources & db & tests to oslo.i18n
Browse files Browse the repository at this point in the history
Use oslo.i18n in resources & db & tests directories.

blueprint oslo-i18n

Change-Id: Idaf718b9d762b9ae89d6045557eadb758b552bd5
  • Loading branch information
Ethan Lynn committed Sep 17, 2014
1 parent c2211f0 commit 6d0cd62
Show file tree
Hide file tree
Showing 39 changed files with 52 additions and 48 deletions.
Expand Up @@ -16,10 +16,10 @@

import six

from heat.common.i18n import _
from heat.engine import attributes
from heat.engine import properties
from heat.engine import resource
from heat.openstack.common.gettextutils import _
from heat.openstack.common import log as logging

LOG = logging.getLogger(__name__)
Expand Down
Expand Up @@ -19,7 +19,7 @@
from oslo.config import cfg

from heat.common import exception
from heat.openstack.common.gettextutils import _
from heat.common.i18n import _
from heat.openstack.common import importutils
from heat.openstack.common import log as logging

Expand Down
2 changes: 1 addition & 1 deletion contrib/nova_flavor/nova_flavor/resources/nova_flavor.py
Expand Up @@ -11,9 +11,9 @@
# License for the specific language governing permissions and limitations
# under the License.

from heat.common.i18n import _
from heat.engine import properties
from heat.engine import resource
from heat.openstack.common.gettextutils import _


class NovaFlavor(resource.Resource):
Expand Down
2 changes: 1 addition & 1 deletion contrib/rackspace/rackspace/clients.py
Expand Up @@ -18,13 +18,13 @@
from oslo.config import cfg

from heat.common import exception
from heat.common.i18n import _
from heat.engine.clients import client_plugin
from heat.engine.clients.os import cinder
from heat.engine.clients.os import glance
from heat.engine.clients.os import nova
from heat.engine.clients.os import trove

from heat.openstack.common.gettextutils import _
from heat.openstack.common import log as logging

from glanceclient import client as gc
Expand Down
2 changes: 1 addition & 1 deletion contrib/rackspace/rackspace/resources/cloud_dns.py
Expand Up @@ -14,10 +14,10 @@
"""Resources for Rackspace DNS."""

from heat.common import exception
from heat.common.i18n import _
from heat.engine import constraints
from heat.engine import properties
from heat.engine import resource
from heat.openstack.common.gettextutils import _
from heat.openstack.common import log as logging

try:
Expand Down
Expand Up @@ -17,14 +17,14 @@
import six

from heat.common import exception
from heat.common.i18n import _
from heat.engine import attributes
from heat.engine import constraints
from heat.engine import function
from heat.engine import properties
from heat.engine.properties import Properties
from heat.engine import resource
from heat.engine import scheduler
from heat.openstack.common.gettextutils import _
from heat.openstack.common import log as logging

try:
Expand Down
2 changes: 1 addition & 1 deletion contrib/rackspace/rackspace/resources/cloud_server.py
Expand Up @@ -14,10 +14,10 @@
import copy

from heat.common import exception
from heat.common.i18n import _
from heat.engine import attributes
from heat.engine import properties
from heat.engine.resources import server
from heat.openstack.common.gettextutils import _
from heat.openstack.common import log as logging

try:
Expand Down
2 changes: 1 addition & 1 deletion contrib/rackspace/rackspace/resources/cloudnetworks.py
Expand Up @@ -14,11 +14,11 @@
import netaddr

from heat.common import exception
from heat.common.i18n import _
from heat.engine import attributes
from heat.engine import constraints
from heat.engine import properties
from heat.engine import resource
from heat.openstack.common.gettextutils import _
from heat.openstack.common import log as logging

try:
Expand Down
2 changes: 1 addition & 1 deletion doc/source/ext/resources.py
Expand Up @@ -19,13 +19,13 @@
import pydoc
from sphinx.util.compat import Directive

from heat.common.i18n import _
from heat.engine import attributes
from heat.engine import environment
from heat.engine import plugin_manager
from heat.engine import properties
from heat.engine import resources
from heat.engine import support
from heat.openstack.common.gettextutils import _


global_env = environment.Environment({}, user_env=False)
Expand Down
2 changes: 1 addition & 1 deletion doc/source/pluginguide.rst
Expand Up @@ -108,9 +108,9 @@ plug-in.

.. code-block:: python
from heat.common.i18n import _
from heat.engine import constraints
from heat.engine import properties
from heat.openstack.common.gettextutils import _
nested_schema = {
"foo": properties.Schema(
Expand Down
8 changes: 5 additions & 3 deletions heat/__init__.py
Expand Up @@ -14,7 +14,9 @@
# License for the specific language governing permissions and limitations
# under the License.

from heat.openstack.common import gettextutils
from oslo import i18n

gettextutils.enable_lazy()
gettextutils.install('heat', lazy=True)
i18n.enable_lazy()
# fixme(elynn): Since install() is deprecated, we should remove it in
# the future
i18n.install('heat')
2 changes: 1 addition & 1 deletion heat/db/sqlalchemy/api.py
Expand Up @@ -25,10 +25,10 @@

from heat.common import crypt
from heat.common import exception
from heat.common.i18n import _
from heat.db.sqlalchemy import filters as db_filters
from heat.db.sqlalchemy import migration
from heat.db.sqlalchemy import models
from heat.openstack.common.gettextutils import _

CONF = cfg.CONF
CONF.import_opt('max_events_per_stack', 'heat.common.config')
Expand Down
Expand Up @@ -16,7 +16,7 @@
from migrate.versioning import util as migrate_util
import sqlalchemy

from heat.openstack.common.gettextutils import _
from heat.common.i18n import _


def upgrade(migrate_engine):
Expand Down
Expand Up @@ -17,9 +17,9 @@
import six
from sqlalchemy.orm import sessionmaker

from heat.common.i18n import _
from heat.db.sqlalchemy import models
from heat.engine.hot.parameters import HOTParamSchema
from heat.openstack.common.gettextutils import _


def upgrade(migrate_engine):
Expand Down
Expand Up @@ -16,8 +16,8 @@
import six
from sqlalchemy.orm import sessionmaker

from heat.common.i18n import _
from heat.db.sqlalchemy import models
from heat.openstack.common.gettextutils import _


def upgrade(migrate_engine):
Expand Down
Expand Up @@ -16,8 +16,8 @@
from migrate.versioning import util as migrate_util
from sqlalchemy.orm import sessionmaker

from heat.common.i18n import _
from heat.db.sqlalchemy import models
from heat.openstack.common.gettextutils import _


def upgrade(migrate_engine):
Expand Down
6 changes: 4 additions & 2 deletions heat/db/sync.py
Expand Up @@ -17,12 +17,14 @@
import sys

from oslo.config import cfg
from oslo import i18n

from heat.db import migration
from heat.openstack.common import gettextutils
from heat.openstack.common import log as logging

gettextutils.install('heat')
# fixme(elynn): Since install() is deprecated, we should remove it in
# the future
i18n.install('heat')

LOG = logging.getLogger(__name__)

Expand Down
2 changes: 1 addition & 1 deletion heat/engine/resources/eip.py
Expand Up @@ -12,13 +12,13 @@
# under the License.

from heat.common import exception
from heat.common.i18n import _
from heat.engine import attributes
from heat.engine import constraints
from heat.engine import properties
from heat.engine import resource
from heat.engine.resources.vpc import VPC
from heat.openstack.common import excutils
from heat.openstack.common.gettextutils import _
from heat.openstack.common import log as logging

LOG = logging.getLogger(__name__)
Expand Down
2 changes: 1 addition & 1 deletion heat/engine/resources/glance_image.py
Expand Up @@ -11,10 +11,10 @@
# License for the specific language governing permissions and limitations
# under the License.

from heat.common.i18n import _
from heat.engine import constraints
from heat.engine import properties
from heat.engine import resource
from heat.openstack.common.gettextutils import _


class GlanceImage(resource.Resource):
Expand Down
2 changes: 1 addition & 1 deletion heat/engine/resources/instance.py
Expand Up @@ -17,14 +17,14 @@
import six

from heat.common import exception
from heat.common.i18n import _
from heat.engine import attributes
from heat.engine import constraints
from heat.engine import properties
from heat.engine import resource
from heat.engine.resources import volume
from heat.engine import scheduler
from heat.engine import signal_responder
from heat.openstack.common.gettextutils import _
from heat.openstack.common import log as logging

cfg.CONF.import_opt('instance_user', 'heat.common.config')
Expand Down
2 changes: 1 addition & 1 deletion heat/engine/resources/internet_gateway.py
Expand Up @@ -12,10 +12,10 @@
# under the License.

from heat.common import exception
from heat.common.i18n import _
from heat.engine import properties
from heat.engine import resource
from heat.engine.resources import route_table
from heat.openstack.common.gettextutils import _


class InternetGateway(resource.Resource):
Expand Down
2 changes: 1 addition & 1 deletion heat/engine/resources/loadbalancer.py
Expand Up @@ -15,12 +15,12 @@
from oslo.config import cfg

from heat.common import exception
from heat.common.i18n import _
from heat.common import template_format
from heat.engine import attributes
from heat.engine import constraints
from heat.engine import properties
from heat.engine import stack_resource
from heat.openstack.common.gettextutils import _
from heat.openstack.common import log as logging

LOG = logging.getLogger(__name__)
Expand Down
2 changes: 1 addition & 1 deletion heat/engine/resources/nova_floatingip.py
Expand Up @@ -11,11 +11,11 @@
# License for the specific language governing permissions and limitations
# under the License.

from heat.common.i18n import _
from heat.engine import attributes
from heat.engine import properties
from heat.engine import resource
from heat.openstack.common import excutils
from heat.openstack.common.gettextutils import _
from heat.openstack.common import log as logging

LOG = logging.getLogger(__name__)
Expand Down
2 changes: 1 addition & 1 deletion heat/engine/resources/nova_keypair.py
Expand Up @@ -12,11 +12,11 @@
# under the License.

from heat.common import exception
from heat.common.i18n import _
from heat.engine import attributes
from heat.engine import constraints
from heat.engine import properties
from heat.engine import resource
from heat.openstack.common.gettextutils import _


class KeyPair(resource.Resource):
Expand Down
2 changes: 1 addition & 1 deletion heat/engine/resources/nova_servergroup.py
Expand Up @@ -10,10 +10,10 @@
# License for the specific language governing permissions and limitations
# under the License.

from heat.common.i18n import _
from heat.engine import constraints
from heat.engine import properties
from heat.engine import resource
from heat.openstack.common.gettextutils import _


class ServerGroup(resource.Resource):
Expand Down
2 changes: 1 addition & 1 deletion heat/engine/resources/nova_utils.py
Expand Up @@ -27,8 +27,8 @@
import warnings

from heat.common import exception
from heat.common.i18n import _
from heat.engine import scheduler
from heat.openstack.common.gettextutils import _
from heat.openstack.common import log as logging

LOG = logging.getLogger(__name__)
Expand Down
2 changes: 1 addition & 1 deletion heat/engine/resources/os_database.py
Expand Up @@ -12,11 +12,11 @@
# under the License.

from heat.common import exception
from heat.common.i18n import _
from heat.engine import attributes
from heat.engine import constraints
from heat.engine import properties
from heat.engine import resource
from heat.openstack.common.gettextutils import _
from heat.openstack.common import log as logging
from heat.openstack.common import uuidutils

Expand Down
2 changes: 1 addition & 1 deletion heat/engine/resources/random_string.py
Expand Up @@ -17,12 +17,12 @@
from six.moves import xrange

from heat.common import exception
from heat.common.i18n import _
from heat.engine import attributes
from heat.engine import constraints
from heat.engine import properties
from heat.engine import resource
from heat.engine import support
from heat.openstack.common.gettextutils import _


class RandomString(resource.Resource):
Expand Down
2 changes: 1 addition & 1 deletion heat/engine/resources/resource_group.py
Expand Up @@ -15,12 +15,12 @@
import copy

from heat.common import exception
from heat.common.i18n import _
from heat.engine import attributes
from heat.engine import constraints
from heat.engine import properties
from heat.engine import stack_resource
from heat.engine import template
from heat.openstack.common.gettextutils import _

template_template = {
"heat_template_version": "2013-05-23",
Expand Down
2 changes: 1 addition & 1 deletion heat/engine/resources/sahara_cluster.py
Expand Up @@ -14,11 +14,11 @@
# limitations under the License.

from heat.common import exception
from heat.common.i18n import _
from heat.engine import attributes
from heat.engine import constraints
from heat.engine import properties
from heat.engine import resource
from heat.openstack.common.gettextutils import _
from heat.openstack.common import log as logging

LOG = logging.getLogger(__name__)
Expand Down
2 changes: 1 addition & 1 deletion heat/engine/resources/sahara_templates.py
Expand Up @@ -14,10 +14,10 @@
# limitations under the License.

from heat.common import exception
from heat.common.i18n import _
from heat.engine import constraints
from heat.engine import properties
from heat.engine import resource
from heat.openstack.common.gettextutils import _
from heat.openstack.common import log as logging

LOG = logging.getLogger(__name__)
Expand Down

0 comments on commit 6d0cd62

Please sign in to comment.