Import the stack module directly
Note: the patch imports "stack as parser" in some places to maintain API (service.py and event.py). Change-Id: I0409a04789f0ca362cb9ab0b612d47226d785334
This commit is contained in:
parent
35d7465c11
commit
5131d6c9b2
@ -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)
|
||||
|
@ -34,10 +34,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
|
||||
|
@ -17,9 +17,9 @@ from heat.common import environment_format
|
||||
from heat.common import exception
|
||||
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.gettextutils import _
|
||||
from heat.openstack.common import log as logging
|
||||
|
@ -16,7 +16,7 @@ import datetime
|
||||
|
||||
from heat.common import exception
|
||||
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.gettextutils import _
|
||||
from heat.openstack.common import log as logging
|
||||
@ -256,11 +256,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)
|
||||
|
@ -36,11 +36,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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
@ -87,12 +87,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):
|
||||
@ -109,7 +109,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
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user