]> review.fuel-infra Code Review - openstack-build/heat-build.git/commitdiff
add missing gettextutils imports
authorSteven Hardy <shardy@redhat.com>
Tue, 2 Jul 2013 13:22:24 +0000 (14:22 +0100)
committerSteven Hardy <shardy@redhat.com>
Tue, 2 Jul 2013 13:22:24 +0000 (14:22 +0100)
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

15 files changed:
heat/api/middleware/version_negotiation.py
heat/api/openstack/v1/stacks.py
heat/api/openstack/v1/util.py
heat/common/auth.py
heat/common/client.py
heat/common/plugin_loader.py
heat/common/policy.py
heat/common/urlfetch.py
heat/common/wsgi.py
heat/db/sqlalchemy/migration.py
heat/engine/dependencies.py
heat/engine/parser.py
heat/engine/resource.py
heat/engine/resources/__init__.py
heat/engine/scheduler.py

index 1aff84f6919067c3898c192f95c1ed3905d3fdfa..5308136a8591f8fce8c6993783294eba3d9ec33c 100644 (file)
@@ -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
 
index 44473e13e2362413f79bdfb5242e5cc1980cda4f..97d254e796a17a35a9fc18bf94d01cfec63b9c9d 100644 (file)
@@ -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__)
 
index f9666346e32aee87b775aee41ae2ad17ce7ba40f..76920868d5b470b0d5f1b6d4d4e1d81f76c76b32 100644 (file)
@@ -18,6 +18,8 @@ from functools import wraps
 
 from heat.common import identifier
 
+from heat.openstack.common.gettextutils import _
+
 
 def tenant_local(handler):
     '''
index 290de4e15b80df951480b0fa5b847a0066990950..7ba3b9b57da81261cafa096dbd926a1da9e52b15 100644 (file)
@@ -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:
index 8b8cb9d0906c8c3e6c64b6af29a8fcad1f440fe0..b16b8c629819ab8174578d83ddedacf6e390c6ba 100644 (file)
@@ -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
index 7db0af0e35b3a5deb1e582cc648b235ce8477bbc..eb5efa00bf8a50e04972ec37ea39d150d86a0122 100644 (file)
@@ -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__)
 
index 9b8d564fc8ee32e471a922f47f4d52f077af5d4e..59c81f27d100a3ec4bb76664b19213d4ab30826e 100644 (file)
@@ -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__)
 
index 13fa9223218a433c53f103a06a58599490771b04..bde5f75683142c05eb31de631bf0025bb479870c 100644 (file)
@@ -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__)
 
index 4833e22d311d5b057ccdfe6cdd6e4e2280e45ff1..a355f355667814e7e98fc0040cdd3a04af1d3437 100644 (file)
@@ -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
index 22c7345760f2743444a3eac634107f72dd669511..eeaa255b9590352df81e5fa092b484d2dca05a00 100644 (file)
@@ -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
 
index f8f6e6272007b7e6deefbd1501c72672e57a7d63..7f0b9a0595dd410ef37b1e30cc5a244de8a1b83b 100644 (file)
@@ -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")
index 501d6590f7c1b3d928b91e0f9bf3b4175190d3f9..c966f237f5e200e04d0585a57186f211b9b4cb4a 100644 (file)
@@ -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
 
index fc466f54c30670bedd2f6771a670e446581cb3c9..ea4a0b5b36756f797ecc474c8862bef4bd076006 100644 (file)
@@ -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__)
 
index 1e117455967d6a1b3053709f270738d4a3bbd0e6..28bdc4004fb1061ec0fb1df97af50177bd4fea06 100644 (file)
@@ -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__)
index ab98748273b6714a0a35f0c63885a5b5d20d5538..4b010479192e7aa2c64c94edb420e540a61c7996 100644 (file)
@@ -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__)