Merge "Import the stack module directly"

This commit is contained in:
Jenkins 2014-10-06 08:16:22 +00:00 committed by Gerrit Code Review
commit ec0a6720ab
7 changed files with 17 additions and 17 deletions

View File

@ -52,7 +52,7 @@ class Event(object):
@classmethod
def load(cls, context, event_id, event=None, stack=None):
'''Retrieve an Event from the database.'''
from heat.engine import parser
from heat.engine import stack as parser
ev = event if event is not None else\
db_api.event_get(context, event_id)

View File

@ -38,10 +38,10 @@ from heat.engine import clients
from heat.engine import environment
from heat.engine.event import Event
from heat.engine import parameter_groups
from heat.engine import parser
from heat.engine import properties
from heat.engine import resource
from heat.engine import resources
from heat.engine import stack as parser
from heat.engine import stack_lock
from heat.engine import template as templatem
from heat.engine import watchrule

View File

@ -18,9 +18,9 @@ from heat.common import exception
from heat.common.i18n import _
from heat.engine import attributes
from heat.engine import environment
from heat.engine import parser
from heat.engine import resource
from heat.engine import scheduler
from heat.engine import stack as parser
from heat.engine import template
from heat.openstack.common import log as logging

View File

@ -19,7 +19,7 @@ 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 stack
from heat.engine import timestamp
from heat.openstack.common import log as logging
from heat.rpc import api as rpc_api
@ -257,11 +257,11 @@ class WatchRule(object):
else:
s = db_api.stack_get(self.context, self.stack_id,
eager_load=True)
stack = parser.Stack.load(self.context, stack=s)
if (stack.action != stack.DELETE
and stack.status == stack.COMPLETE):
stk = stack.Stack.load(self.context, stack=s)
if (stk.action != stk.DELETE
and stk.status == stk.COMPLETE):
for refid in self.rule[self.ACTION_MAP[new_state]]:
actions.append(stack.resource_by_refid(refid).signal)
actions.append(stk.resource_by_refid(refid).signal)
else:
LOG.warning(_("Could not process watch state %s for stack")
% new_state)

View File

@ -38,11 +38,11 @@ from heat.engine.clients.os import keystone
from heat.engine.clients.os import nova
from heat.engine import dependencies
from heat.engine import environment
from heat.engine import parser
from heat.engine.properties import Properties
from heat.engine import resource as res
from heat.engine.resources import instance as instances
from heat.engine import service
from heat.engine import stack as parser
from heat.engine import stack_lock
from heat.engine import template as templatem
from heat.engine import watchrule

View File

@ -20,9 +20,9 @@ import mox
from heat.common import exception
from heat.common import template_format
from heat.engine import environment
from heat.engine import parser
from heat.engine import resource
from heat.engine import scheduler
from heat.engine import stack as parser
from heat.engine import stack_resource
from heat.engine import template as templatem
from heat.tests.common import HeatTestCase

View File

@ -22,8 +22,8 @@ import sqlalchemy
from heat.common import context
from heat.db import api as db_api
from heat.engine import environment
from heat.engine import parser
from heat.engine import resource
from heat.engine import stack
from heat.engine import template
get_engine = db_api.get_engine
@ -89,12 +89,12 @@ def parse_stack(t, params=None, stack_name='test_stack', stack_id=None,
params = params or {}
ctx = dummy_context()
templ = template.Template(t)
stack = parser.Stack(ctx, stack_name, templ,
environment.Environment(params), stack_id,
timeout_mins=timeout_mins)
stack.store()
stk = stack.Stack(ctx, stack_name, templ,
environment.Environment(params), stack_id,
timeout_mins=timeout_mins)
stk.store()
return stack
return stk
class PhysName(object):
@ -111,7 +111,7 @@ class PhysName(object):
def __eq__(self, physical_name):
try:
stack, res, short_id = str(physical_name).rsplit('-', 2)
stk, res, short_id = str(physical_name).rsplit('-', 2)
except ValueError:
return False