From: Steven Hardy Date: Tue, 2 Jul 2013 13:22:24 +0000 (+0100) Subject: add missing gettextutils imports X-Git-Tag: 2014.1~401^2 X-Git-Url: https://review.fuel-infra.org/gitweb?a=commitdiff_plain;h=ec40a9ebe7e9fe1129a2509b80de52ca7b2854ca;p=openstack-build%2Fheat-build.git add missing gettextutils imports Several files use the "_" function, but don't import it from gettextutils - this leads to a "NameError: name '_' is not defined" error if you try to import/use the modules from an interactive python shell or standalone test-code. Change-Id: Id28b45d71eeda64fbfaa6234b12cff45fcd2ce40 --- diff --git a/heat/api/middleware/version_negotiation.py b/heat/api/middleware/version_negotiation.py index 1aff84f6..5308136a 100644 --- a/heat/api/middleware/version_negotiation.py +++ b/heat/api/middleware/version_negotiation.py @@ -22,6 +22,7 @@ return import re from heat.openstack.common import log as logging +from heat.openstack.common.gettextutils import _ from heat.common import wsgi diff --git a/heat/api/openstack/v1/stacks.py b/heat/api/openstack/v1/stacks.py index 44473e13..97d254e7 100644 --- a/heat/api/openstack/v1/stacks.py +++ b/heat/api/openstack/v1/stacks.py @@ -30,6 +30,7 @@ from heat.common import urlfetch import heat.openstack.common.rpc.common as rpc_common from heat.openstack.common import log as logging +from heat.openstack.common.gettextutils import _ logger = logging.getLogger(__name__) diff --git a/heat/api/openstack/v1/util.py b/heat/api/openstack/v1/util.py index f9666346..76920868 100644 --- a/heat/api/openstack/v1/util.py +++ b/heat/api/openstack/v1/util.py @@ -18,6 +18,8 @@ from functools import wraps from heat.common import identifier +from heat.openstack.common.gettextutils import _ + def tenant_local(handler): ''' diff --git a/heat/common/auth.py b/heat/common/auth.py index 290de4e1..7ba3b9b5 100644 --- a/heat/common/auth.py +++ b/heat/common/auth.py @@ -34,6 +34,8 @@ import urlparse from heat.common import exception +from heat.openstack.common.gettextutils import _ + class BaseStrategy(object): def __init__(self): @@ -117,7 +119,7 @@ class KeystoneStrategy(BaseStrategy): self.check_auth_params() auth_url = self.creds['auth_url'] - for _ in range(self.MAX_REDIRECTS): + for x in range(self.MAX_REDIRECTS): try: _authenticate(auth_url) except exception.AuthorizationRedirect as e: diff --git a/heat/common/client.py b/heat/common/client.py index 8b8cb9d0..b16b8c62 100644 --- a/heat/common/client.py +++ b/heat/common/client.py @@ -35,6 +35,8 @@ from heat.common import auth from heat.common import exception from heat.common import utils +from heat.openstack.common.gettextutils import _ + # common chunk size for get and put CHUNKSIZE = 65536 diff --git a/heat/common/plugin_loader.py b/heat/common/plugin_loader.py index 7db0af0e..eb5efa00 100644 --- a/heat/common/plugin_loader.py +++ b/heat/common/plugin_loader.py @@ -27,6 +27,7 @@ import sys import types from heat.openstack.common import log as logging +from heat.openstack.common.gettextutils import _ logger = logging.getLogger(__name__) diff --git a/heat/common/policy.py b/heat/common/policy.py index 9b8d564f..59c81f27 100644 --- a/heat/common/policy.py +++ b/heat/common/policy.py @@ -24,8 +24,10 @@ import os.path from oslo.config import cfg from heat.common import exception + import heat.openstack.common.log as logging from heat.openstack.common import policy +from heat.openstack.common.gettextutils import _ logger = logging.getLogger(__name__) diff --git a/heat/common/urlfetch.py b/heat/common/urlfetch.py index 13fa9223..bde5f756 100644 --- a/heat/common/urlfetch.py +++ b/heat/common/urlfetch.py @@ -21,6 +21,7 @@ import urllib2 import urlparse from heat.openstack.common import log as logging +from heat.openstack.common.gettextutils import _ logger = logging.getLogger(__name__) diff --git a/heat/common/wsgi.py b/heat/common/wsgi.py index 4833e22d..a355f355 100644 --- a/heat/common/wsgi.py +++ b/heat/common/wsgi.py @@ -44,6 +44,7 @@ import webob.exc from heat.common import exception from heat.openstack.common import importutils +from heat.openstack.common.gettextutils import _ URL_LENGTH_LIMIT = 50000 diff --git a/heat/db/sqlalchemy/migration.py b/heat/db/sqlalchemy/migration.py index 22c73457..eeaa255b 100644 --- a/heat/db/sqlalchemy/migration.py +++ b/heat/db/sqlalchemy/migration.py @@ -24,6 +24,7 @@ import migrate from migrate.versioning import util as migrate_util from heat.openstack.common import exception +from heat.openstack.common.gettextutils import _ _REPOSITORY = None diff --git a/heat/engine/dependencies.py b/heat/engine/dependencies.py index f8f6e627..7f0b9a05 100644 --- a/heat/engine/dependencies.py +++ b/heat/engine/dependencies.py @@ -18,6 +18,8 @@ import itertools from heat.common import exception +from heat.openstack.common.gettextutils import _ + class CircularDependencyException(exception.OpenstackException): message = _("Circular Dependency Found: %(cycle)s") diff --git a/heat/engine/parser.py b/heat/engine/parser.py index 501d6590..c966f237 100644 --- a/heat/engine/parser.py +++ b/heat/engine/parser.py @@ -32,6 +32,8 @@ from heat.engine.clients import Clients from heat.db import api as db_api from heat.openstack.common import log as logging +from heat.openstack.common.gettextutils import _ + from heat.common.exception import ServerError from heat.common.exception import StackValidationFailed diff --git a/heat/engine/resource.py b/heat/engine/resource.py index fc466f54..ea4a0b5b 100644 --- a/heat/engine/resource.py +++ b/heat/engine/resource.py @@ -28,6 +28,7 @@ from heat.engine.attributes import Attributes from heat.engine.properties import Properties from heat.openstack.common import log as logging +from heat.openstack.common.gettextutils import _ logger = logging.getLogger(__name__) diff --git a/heat/engine/resources/__init__.py b/heat/engine/resources/__init__.py index 1e117455..28bdc400 100644 --- a/heat/engine/resources/__init__.py +++ b/heat/engine/resources/__init__.py @@ -13,6 +13,7 @@ # License for the specific language governing permissions and limitations # under the License. from heat.openstack.common import log as logging +from heat.openstack.common.gettextutils import _ logger = logging.getLogger(__name__) diff --git a/heat/engine/scheduler.py b/heat/engine/scheduler.py index ab987482..4b010479 100644 --- a/heat/engine/scheduler.py +++ b/heat/engine/scheduler.py @@ -22,6 +22,7 @@ from time import time as wallclock from heat.openstack.common import excutils from heat.openstack.common import log as logging +from heat.openstack.common.gettextutils import _ logger = logging.getLogger(__name__)