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 @classmethod
def load(cls, context, event_id, event=None, stack=None): def load(cls, context, event_id, event=None, stack=None):
'''Retrieve an Event from the database.''' '''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\ ev = event if event is not None else\
db_api.event_get(context, event_id) 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 import environment
from heat.engine.event import Event from heat.engine.event import Event
from heat.engine import parameter_groups from heat.engine import parameter_groups
from heat.engine import parser
from heat.engine import properties from heat.engine import properties
from heat.engine import resource from heat.engine import resource
from heat.engine import resources from heat.engine import resources
from heat.engine import stack as parser
from heat.engine import stack_lock from heat.engine import stack_lock
from heat.engine import template as templatem from heat.engine import template as templatem
from heat.engine import watchrule from heat.engine import watchrule

View File

@ -18,9 +18,9 @@ from heat.common import exception
from heat.common.i18n import _ from heat.common.i18n import _
from heat.engine import attributes from heat.engine import attributes
from heat.engine import environment from heat.engine import environment
from heat.engine import parser
from heat.engine import resource from heat.engine import resource
from heat.engine import scheduler from heat.engine import scheduler
from heat.engine import stack as parser
from heat.engine import template from heat.engine import template
from heat.openstack.common import log as logging 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 import exception
from heat.common.i18n import _ from heat.common.i18n import _
from heat.db import api as db_api 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.engine import timestamp
from heat.openstack.common import log as logging from heat.openstack.common import log as logging
from heat.rpc import api as rpc_api from heat.rpc import api as rpc_api
@ -257,11 +257,11 @@ class WatchRule(object):
else: else:
s = db_api.stack_get(self.context, self.stack_id, s = db_api.stack_get(self.context, self.stack_id,
eager_load=True) eager_load=True)
stack = parser.Stack.load(self.context, stack=s) stk = stack.Stack.load(self.context, stack=s)
if (stack.action != stack.DELETE if (stk.action != stk.DELETE
and stack.status == stack.COMPLETE): and stk.status == stk.COMPLETE):
for refid in self.rule[self.ACTION_MAP[new_state]]: 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: else:
LOG.warning(_("Could not process watch state %s for stack") LOG.warning(_("Could not process watch state %s for stack")
% new_state) % 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.clients.os import nova
from heat.engine import dependencies from heat.engine import dependencies
from heat.engine import environment from heat.engine import environment
from heat.engine import parser
from heat.engine.properties import Properties from heat.engine.properties import Properties
from heat.engine import resource as res from heat.engine import resource as res
from heat.engine.resources import instance as instances from heat.engine.resources import instance as instances
from heat.engine import service from heat.engine import service
from heat.engine import stack as parser
from heat.engine import stack_lock from heat.engine import stack_lock
from heat.engine import template as templatem from heat.engine import template as templatem
from heat.engine import watchrule from heat.engine import watchrule

View File

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

View File

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