summaryrefslogtreecommitdiff
path: root/heat
diff options
context:
space:
mode:
authorJulien Danjou <julien@danjou.info>2014-09-30 11:46:52 +0200
committerJulien Danjou <julien@danjou.info>2014-09-30 14:27:59 +0200
commit6519cf36fd5ffd88a45e53ca69080c4b421915d6 (patch)
tree875a7fc640f333a134e5165d197f1d095474a015 /heat
parenta11480323307c6315c89ea8ab3cb6e4939550672 (diff)
downloadheat-6519cf36fd5ffd88a45e53ca69080c4b421915d6.tar.gz
Switch to oslo.utils
Change-Id: I74979d8f75b099858314a30c98bb252c379e0304
Diffstat (limited to 'heat')
-rw-r--r--heat/api/aws/ec2token.py2
-rw-r--r--heat/common/auth_url.py2
-rw-r--r--heat/common/context.py3
-rw-r--r--heat/common/heat_keystoneclient.py2
-rw-r--r--heat/common/identifier.py5
-rw-r--r--heat/common/param_utils.py3
-rw-r--r--heat/common/wsgi.py2
-rw-r--r--heat/db/sqlalchemy/migrate_repo/versions/035_event_uuid_to_id.py3
-rw-r--r--heat/db/sqlalchemy/models.py2
-rw-r--r--heat/engine/api.py3
-rw-r--r--heat/engine/clients/__init__.py2
-rw-r--r--heat/engine/constraints.py2
-rw-r--r--heat/engine/parameters.py7
-rw-r--r--heat/engine/resource.py2
-rw-r--r--heat/engine/resources/autoscaling.py2
-rw-r--r--heat/engine/resources/eip.py3
-rw-r--r--heat/engine/resources/nova_floatingip.py3
-rw-r--r--heat/engine/scheduler.py2
-rw-r--r--heat/engine/service.py2
-rw-r--r--heat/engine/stack.py4
-rw-r--r--heat/engine/stack_lock.py2
-rw-r--r--heat/engine/watchrule.py3
-rw-r--r--heat/scaling/cooldown.py2
-rw-r--r--heat/tests/test_api_ec2token.py2
-rw-r--r--heat/tests/test_autoscaling.py2
-rw-r--r--heat/tests/test_heat_autoscaling_group.py2
-rw-r--r--heat/tests/test_notifications.py2
-rw-r--r--heat/tests/test_sqlalchemy_api.py2
-rw-r--r--heat/tests/test_watch.py2
29 files changed, 40 insertions, 35 deletions
diff --git a/heat/api/aws/ec2token.py b/heat/api/aws/ec2token.py
index c3efa73c2..921720068 100644
--- a/heat/api/aws/ec2token.py
+++ b/heat/api/aws/ec2token.py
@@ -14,6 +14,7 @@
import hashlib
from oslo.config import cfg
+from oslo.utils import importutils
import requests
import webob
@@ -23,7 +24,6 @@ from heat.common.i18n import _
from heat.common.i18n import _LE
from heat.common.i18n import _LI
from heat.common import wsgi
-from heat.openstack.common import importutils
from heat.openstack.common import jsonutils as json
from heat.openstack.common import log as logging
diff --git a/heat/common/auth_url.py b/heat/common/auth_url.py
index d588700aa..d80b10350 100644
--- a/heat/common/auth_url.py
+++ b/heat/common/auth_url.py
@@ -15,11 +15,11 @@
# limitations under the License.
from oslo.config import cfg
+from oslo.utils import importutils
from webob.exc import HTTPBadRequest
from webob.exc import HTTPUnauthorized
from heat.common import wsgi
-from heat.openstack.common import importutils
class AuthUrlFilter(wsgi.Middleware):
diff --git a/heat/common/context.py b/heat/common/context.py
index 6eb3e8c3f..2e4b78d06 100644
--- a/heat/common/context.py
+++ b/heat/common/context.py
@@ -11,13 +11,14 @@
# License for the specific language governing permissions and limitations
# under the License.
+from oslo.utils import importutils
+
from heat.common import exception
from heat.common import policy
from heat.common import wsgi
from heat.db import api as db_api
from heat.engine import clients
from heat.openstack.common import context
-from heat.openstack.common import importutils
from heat.openstack.common import local
from heat.openstack.common.middleware import request_id
diff --git a/heat/common/heat_keystoneclient.py b/heat/common/heat_keystoneclient.py
index cafd60cdb..c2aecc3c3 100644
--- a/heat/common/heat_keystoneclient.py
+++ b/heat/common/heat_keystoneclient.py
@@ -16,6 +16,7 @@
from collections import namedtuple
import copy
import json
+from oslo.utils import importutils
import uuid
from keystoneclient.auth.identity import v3 as kc_auth_v3
@@ -29,7 +30,6 @@ from heat.common import exception
from heat.common.i18n import _
from heat.common.i18n import _LE
from heat.common.i18n import _LW
-from heat.openstack.common import importutils
from heat.openstack.common import log as logging
LOG = logging.getLogger('heat.common.keystoneclient')
diff --git a/heat/common/identifier.py b/heat/common/identifier.py
index c8228703a..f4789d2a0 100644
--- a/heat/common/identifier.py
+++ b/heat/common/identifier.py
@@ -14,10 +14,9 @@
import collections
import re
+from oslo.utils import encodeutils
from six.moves.urllib import parse as urlparse
-from heat.openstack.common import strutils
-
class HeatIdentifier(collections.Mapping):
@@ -116,7 +115,7 @@ class HeatIdentifier(collections.Mapping):
stacks/<stack_name>/<stack_id><path>
"""
return 'stacks/%s%s' % (self.stack_path(),
- urlparse.quote(strutils.safe_encode(
+ urlparse.quote(encodeutils.safe_encode(
self.path)))
def stack_path(self):
diff --git a/heat/common/param_utils.py b/heat/common/param_utils.py
index 7bf3fc51d..ceacd0953 100644
--- a/heat/common/param_utils.py
+++ b/heat/common/param_utils.py
@@ -11,8 +11,9 @@
# License for the specific language governing permissions and limitations
# under the License.
+from oslo.utils import strutils
+
from heat.openstack.common.gettextutils import _
-from heat.openstack.common import strutils
def extract_bool(subject):
diff --git a/heat/common/wsgi.py b/heat/common/wsgi.py
index 848079089..b8dc36c01 100644
--- a/heat/common/wsgi.py
+++ b/heat/common/wsgi.py
@@ -34,6 +34,7 @@ from eventlet.green import ssl
import eventlet.greenio
import eventlet.wsgi
from oslo.config import cfg
+from oslo.utils import importutils
from paste import deploy
import routes
import routes.middleware
@@ -45,7 +46,6 @@ from heat.api.aws import exception as aws_exception
from heat.common import exception
from heat.common import serializers
from heat.openstack.common import gettextutils
-from heat.openstack.common import importutils
URL_LENGTH_LIMIT = 50000
diff --git a/heat/db/sqlalchemy/migrate_repo/versions/035_event_uuid_to_id.py b/heat/db/sqlalchemy/migrate_repo/versions/035_event_uuid_to_id.py
index 37b762d85..850f43455 100644
--- a/heat/db/sqlalchemy/migrate_repo/versions/035_event_uuid_to_id.py
+++ b/heat/db/sqlalchemy/migrate_repo/versions/035_event_uuid_to_id.py
@@ -15,10 +15,9 @@ import itertools
import uuid
import migrate.changeset.constraint as constraint
+from oslo.utils import timeutils
import sqlalchemy
-from heat.openstack.common import timeutils
-
def upgrade(migrate_engine):
if migrate_engine.name == 'sqlite':
diff --git a/heat/db/sqlalchemy/models.py b/heat/db/sqlalchemy/models.py
index c40897842..1aec50575 100644
--- a/heat/db/sqlalchemy/models.py
+++ b/heat/db/sqlalchemy/models.py
@@ -17,6 +17,7 @@ SQLAlchemy models for heat data.
import uuid
from oslo.db.sqlalchemy import models
+from oslo.utils import timeutils
import six
import sqlalchemy
from sqlalchemy.ext.declarative import declarative_base
@@ -25,7 +26,6 @@ from sqlalchemy.orm import relationship
from sqlalchemy.orm.session import Session
from heat.db.sqlalchemy.types import Json
-from heat.openstack.common import timeutils
BASE = declarative_base()
diff --git a/heat/engine/api.py b/heat/engine/api.py
index 5594da3ec..2ffad97de 100644
--- a/heat/engine/api.py
+++ b/heat/engine/api.py
@@ -11,12 +11,13 @@
# License for the specific language governing permissions and limitations
# under the License.
+from oslo.utils import timeutils
+
from heat.common.i18n import _
from heat.common import param_utils
from heat.common import template_format
from heat.engine import constraints as constr
from heat.openstack.common import log as logging
-from heat.openstack.common import timeutils
from heat.rpc import api
LOG = logging.getLogger(__name__)
diff --git a/heat/engine/clients/__init__.py b/heat/engine/clients/__init__.py
index d1e65e4fb..2f2705c36 100644
--- a/heat/engine/clients/__init__.py
+++ b/heat/engine/clients/__init__.py
@@ -12,11 +12,11 @@
# under the License.
from oslo.config import cfg
+from oslo.utils import importutils
from stevedore import extension
import warnings
from heat.common.i18n import _
-from heat.openstack.common import importutils
from heat.openstack.common import log as logging
LOG = logging.getLogger(__name__)
diff --git a/heat/engine/constraints.py b/heat/engine/constraints.py
index 2da0b39e3..bf9c2e107 100644
--- a/heat/engine/constraints.py
+++ b/heat/engine/constraints.py
@@ -15,11 +15,11 @@ import collections
import numbers
import re
+from oslo.utils import strutils
import six
from heat.common import exception
from heat.engine import resources
-from heat.openstack.common import strutils
class Schema(collections.Mapping):
diff --git a/heat/engine/parameters.py b/heat/engine/parameters.py
index 5d8c9c73f..18bdfb30a 100644
--- a/heat/engine/parameters.py
+++ b/heat/engine/parameters.py
@@ -15,11 +15,12 @@ import collections
import itertools
import json
+from oslo.utils import encodeutils
+from oslo.utils import strutils
import six
from heat.common import exception
from heat.engine import constraints as constr
-from heat.openstack.common import strutils
PARAMETER_KEYS = (
@@ -270,7 +271,7 @@ class Parameter(object):
if self.hidden():
return '******'
else:
- return strutils.safe_encode(six.text_type(value))
+ return encodeutils.safe_encode(six.text_type(value))
class NumberParam(Parameter):
@@ -394,7 +395,7 @@ class JsonParam(Parameter):
def __str__(self):
if self.hidden():
return super(JsonParam, self).__str__()
- return strutils.safe_decode(json.dumps(self.value()))
+ return encodeutils.safe_decode(json.dumps(self.value()))
def _validate(self, val, context):
val = self.parse(val)
diff --git a/heat/engine/resource.py b/heat/engine/resource.py
index f16cdee3a..b08222cc3 100644
--- a/heat/engine/resource.py
+++ b/heat/engine/resource.py
@@ -15,6 +15,7 @@ import base64
import contextlib
from datetime import datetime
from oslo.config import cfg
+from oslo.utils import excutils
import six
import warnings
@@ -33,7 +34,6 @@ from heat.engine import resources
from heat.engine import rsrc_defn
from heat.engine import scheduler
from heat.engine import support
-from heat.openstack.common import excutils
from heat.openstack.common import log as logging
cfg.CONF.import_opt('action_retry_limit', 'heat.common.config')
diff --git a/heat/engine/resources/autoscaling.py b/heat/engine/resources/autoscaling.py
index b0778c980..0d0b83971 100644
--- a/heat/engine/resources/autoscaling.py
+++ b/heat/engine/resources/autoscaling.py
@@ -14,6 +14,7 @@
import copy
import math
+from oslo.utils import excutils
import six
from heat.common import environment_format
@@ -27,7 +28,6 @@ from heat.engine import properties
from heat.engine import rsrc_defn
from heat.engine import scheduler
from heat.engine import stack_resource
-from heat.openstack.common import excutils
from heat.openstack.common import log as logging
from heat.scaling import cooldown
from heat.scaling import template
diff --git a/heat/engine/resources/eip.py b/heat/engine/resources/eip.py
index 549ec1e25..071a9682d 100644
--- a/heat/engine/resources/eip.py
+++ b/heat/engine/resources/eip.py
@@ -11,6 +11,8 @@
# License for the specific language governing permissions and limitations
# under the License.
+from oslo.utils import excutils
+
from heat.common import exception
from heat.common.i18n import _
from heat.engine import attributes
@@ -18,7 +20,6 @@ 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 import log as logging
LOG = logging.getLogger(__name__)
diff --git a/heat/engine/resources/nova_floatingip.py b/heat/engine/resources/nova_floatingip.py
index 4adb955d7..50de67f3d 100644
--- a/heat/engine/resources/nova_floatingip.py
+++ b/heat/engine/resources/nova_floatingip.py
@@ -11,11 +11,12 @@
# License for the specific language governing permissions and limitations
# under the License.
+from oslo.utils import excutils
+
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 import log as logging
LOG = logging.getLogger(__name__)
diff --git a/heat/engine/scheduler.py b/heat/engine/scheduler.py
index f24d84123..1c257e3b1 100644
--- a/heat/engine/scheduler.py
+++ b/heat/engine/scheduler.py
@@ -18,10 +18,10 @@ from time import time as wallclock
import types
import eventlet
+from oslo.utils import excutils
import six
from heat.common.i18n import _
-from heat.openstack.common import excutils
from heat.openstack.common import log as logging
LOG = logging.getLogger(__name__)
diff --git a/heat/engine/service.py b/heat/engine/service.py
index b2909c852..0160ae55e 100644
--- a/heat/engine/service.py
+++ b/heat/engine/service.py
@@ -19,6 +19,7 @@ import os
import eventlet
from oslo.config import cfg
from oslo import messaging
+from oslo.utils import timeutils
import requests
import six
import warnings
@@ -47,7 +48,6 @@ from heat.openstack.common import jsonutils
from heat.openstack.common import log as logging
from heat.openstack.common import service
from heat.openstack.common import threadgroup
-from heat.openstack.common import timeutils
from heat.openstack.common import uuidutils
from heat.rpc import api as rpc_api
diff --git a/heat/engine/stack.py b/heat/engine/stack.py
index 53b7e8a52..a7db89c7c 100644
--- a/heat/engine/stack.py
+++ b/heat/engine/stack.py
@@ -18,6 +18,7 @@ import re
import warnings
from oslo.config import cfg
+from oslo.utils import encodeutils
import six
from heat.common import context as common_context
@@ -38,7 +39,6 @@ from heat.engine import scheduler
from heat.engine.template import Template
from heat.engine import update
from heat.openstack.common import log as logging
-from heat.openstack.common import strutils
from heat.rpc import api as rpc_api
LOG = logging.getLogger(__name__)
@@ -458,7 +458,7 @@ class Stack(collections.Mapping):
raise ex
except Exception as ex:
LOG.exception(ex)
- raise StackValidationFailed(message=strutils.safe_decode(
+ raise StackValidationFailed(message=encodeutils.safe_decode(
six.text_type(ex)))
if result:
raise StackValidationFailed(message=result)
diff --git a/heat/engine/stack_lock.py b/heat/engine/stack_lock.py
index bb71c80a1..708657138 100644
--- a/heat/engine/stack_lock.py
+++ b/heat/engine/stack_lock.py
@@ -16,12 +16,12 @@ import uuid
from oslo.config import cfg
from oslo import messaging
+from oslo.utils import excutils
from heat.common import exception
from heat.common.i18n import _
from heat.common import messaging as rpc_messaging
from heat.db import api as db_api
-from heat.openstack.common import excutils
from heat.openstack.common import log as logging
cfg.CONF.import_opt('engine_life_check_timeout', 'heat.common.config')
diff --git a/heat/engine/watchrule.py b/heat/engine/watchrule.py
index ab12b391c..d1cfca855 100644
--- a/heat/engine/watchrule.py
+++ b/heat/engine/watchrule.py
@@ -14,13 +14,14 @@
import datetime
+from oslo.utils import timeutils
+
from heat.common import exception
from heat.common.i18n import _
from heat.db import api as db_api
from heat.engine import parser
from heat.engine import timestamp
from heat.openstack.common import log as logging
-from heat.openstack.common import timeutils
from heat.rpc import api as rpc_api
LOG = logging.getLogger(__name__)
diff --git a/heat/scaling/cooldown.py b/heat/scaling/cooldown.py
index 54e84ccc2..882b99de2 100644
--- a/heat/scaling/cooldown.py
+++ b/heat/scaling/cooldown.py
@@ -11,7 +11,7 @@
# License for the specific language governing permissions and limitations
# under the License.
-from heat.openstack.common import timeutils
+from oslo.utils import timeutils
class CooldownMixin(object):
diff --git a/heat/tests/test_api_ec2token.py b/heat/tests/test_api_ec2token.py
index 86ad0df14..47d6e20b3 100644
--- a/heat/tests/test_api_ec2token.py
+++ b/heat/tests/test_api_ec2token.py
@@ -16,12 +16,12 @@ import json
import six
from oslo.config import cfg
+from oslo.utils import importutils
import requests
from heat.api.aws import ec2token
from heat.api.aws import exception
from heat.common.wsgi import Request
-from heat.openstack.common import importutils
from heat.tests.common import HeatTestCase
diff --git a/heat/tests/test_autoscaling.py b/heat/tests/test_autoscaling.py
index 9674278f5..edb804a13 100644
--- a/heat/tests/test_autoscaling.py
+++ b/heat/tests/test_autoscaling.py
@@ -17,6 +17,7 @@ import datetime
import mock
import mox
from oslo.config import cfg
+from oslo.utils import timeutils
import six
from heat.common import exception
@@ -31,7 +32,6 @@ from heat.engine.resources import loadbalancer
from heat.engine.resources.neutron import loadbalancer as neutron_lb
from heat.engine import rsrc_defn
from heat.engine import scheduler
-from heat.openstack.common import timeutils
from heat.tests.common import HeatTestCase
from heat.tests import utils
diff --git a/heat/tests/test_heat_autoscaling_group.py b/heat/tests/test_heat_autoscaling_group.py
index eb3c12f9d..1e2cbc12f 100644
--- a/heat/tests/test_heat_autoscaling_group.py
+++ b/heat/tests/test_heat_autoscaling_group.py
@@ -15,6 +15,7 @@ import datetime
import itertools
from oslo.config import cfg
+from oslo.utils import timeutils
from heat.common import exception
from heat.common import short_id
@@ -23,7 +24,6 @@ from heat.engine import resource
from heat.engine import rsrc_defn
from heat.engine import scheduler
from heat.engine import stack_resource
-from heat.openstack.common import timeutils
from heat.tests.common import HeatTestCase
from heat.tests import generic_resource
from heat.tests import utils
diff --git a/heat/tests/test_notifications.py b/heat/tests/test_notifications.py
index cd78fc722..88fe25ce6 100644
--- a/heat/tests/test_notifications.py
+++ b/heat/tests/test_notifications.py
@@ -12,6 +12,7 @@
# under the License.
import mock
+from oslo.utils import timeutils
from heat.common import exception
from heat.common import template_format
@@ -28,7 +29,6 @@ from heat.engine.resources import user
from heat.engine.resources import wait_condition as waitc
from heat.engine import signal_responder as signal
from heat.engine import stack_resource
-from heat.openstack.common import timeutils
from heat.tests import common
from heat.tests import generic_resource
# reuse the same template than autoscaling tests
diff --git a/heat/tests/test_sqlalchemy_api.py b/heat/tests/test_sqlalchemy_api.py
index c83e76578..a76c5a78b 100644
--- a/heat/tests/test_sqlalchemy_api.py
+++ b/heat/tests/test_sqlalchemy_api.py
@@ -21,6 +21,7 @@ import uuid
import fixtures
import mock
import mox
+from oslo.utils import timeutils
from heat.common import context
from heat.common import exception
@@ -33,7 +34,6 @@ from heat.engine import parser
from heat.engine.resource import Resource
from heat.engine.resources import instance as instances
from heat.engine import scheduler
-from heat.openstack.common import timeutils
from heat.tests.common import HeatTestCase
from heat.tests import utils
from heat.tests.v1_1 import fakes
diff --git a/heat/tests/test_watch.py b/heat/tests/test_watch.py
index ba00ddc98..ccf025725 100644
--- a/heat/tests/test_watch.py
+++ b/heat/tests/test_watch.py
@@ -15,13 +15,13 @@
import datetime
import mox
+from oslo.utils import timeutils
from heat.common import exception
from heat.db import api as db_api
from heat.engine import parser
from heat.engine import template
from heat.engine import watchrule
-from heat.openstack.common import timeutils
from heat.tests.common import HeatTestCase
from heat.tests import utils