Use uuidutils from openstack-common
Change-Id: I6fdd1bf59562a3dbef96da8d30c2733a801acd58 Signed-off-by: Zane Bitter <zbitter@redhat.com>
This commit is contained in:
parent
04fe836b82
commit
c985e79960
|
@ -18,12 +18,12 @@ from heat.common import exception
|
|||
from heat.common import wsgi
|
||||
from heat.openstack.common import cfg
|
||||
from heat.openstack.common import importutils
|
||||
from heat.common import utils as heat_utils
|
||||
from heat.openstack.common import uuidutils
|
||||
from heat.db import api as db_api
|
||||
|
||||
|
||||
def generate_request_id():
|
||||
return 'req-' + str(heat_utils.gen_uuid())
|
||||
return 'req-' + uuidutils.generate_uuid()
|
||||
|
||||
|
||||
class RequestContext(object):
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
from sqlalchemy import *
|
||||
from migrate import *
|
||||
from heat.common import utils
|
||||
from heat.openstack.common import uuidutils
|
||||
|
||||
|
||||
def upgrade(migrate_engine):
|
||||
|
@ -28,7 +28,7 @@ def upgrade(migrate_engine):
|
|||
name=fkey_name).drop()
|
||||
|
||||
stack.c.id.alter(String(36), primary_key=True,
|
||||
default=utils.generate_uuid)
|
||||
default=uuidutils.generate_uuid)
|
||||
event.c.stack_id.alter(String(36), nullable=False)
|
||||
resource.c.stack_id.alter(String(36), nullable=False)
|
||||
|
||||
|
|
|
@ -21,7 +21,7 @@ from sqlalchemy.exc import IntegrityError
|
|||
from sqlalchemy.ext.declarative import declarative_base
|
||||
from sqlalchemy import types as types
|
||||
from json import dumps, loads
|
||||
from heat.common import utils
|
||||
from heat.openstack.common import uuidutils
|
||||
from heat.openstack.common import timeutils
|
||||
from heat.db.sqlalchemy.session import get_session
|
||||
from sqlalchemy.orm.session import Session
|
||||
|
@ -145,7 +145,7 @@ class Stack(BASE, HeatBase):
|
|||
__tablename__ = 'stack'
|
||||
|
||||
id = Column(String, primary_key=True,
|
||||
default=utils.generate_uuid)
|
||||
default=uuidutils.generate_uuid)
|
||||
name = Column(String)
|
||||
raw_template_id = Column(Integer, ForeignKey('raw_template.id'),
|
||||
nullable=False)
|
||||
|
|
|
@ -30,6 +30,7 @@ from heat.openstack.common import log as logging
|
|||
from heat.openstack.common import threadgroup
|
||||
from heat.openstack.common.gettextutils import _
|
||||
from heat.openstack.common.rpc import service
|
||||
from heat.openstack.common import uuidutils
|
||||
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
@ -110,7 +111,7 @@ class EngineService(service.Service):
|
|||
arg1 -> RPC context.
|
||||
arg2 -> Name or UUID of the stack to look up.
|
||||
"""
|
||||
if identifier.HeatIdentifier.is_uuid(stack_name):
|
||||
if uuidutils.is_uuid_like(stack_name):
|
||||
s = db_api.stack_get(context, stack_name)
|
||||
else:
|
||||
s = db_api.stack_get_by_name(context, stack_name)
|
||||
|
|
Loading…
Reference in New Issue