Merge "Release stack lock after export stack"
This commit is contained in:
commit
91bb3e8781
@ -1526,20 +1526,25 @@ class EngineService(service.ServiceBase):
|
|||||||
if not cfg.CONF.enable_stack_abandon:
|
if not cfg.CONF.enable_stack_abandon:
|
||||||
raise exception.NotSupported(feature='Stack Abandon')
|
raise exception.NotSupported(feature='Stack Abandon')
|
||||||
|
|
||||||
|
def _stack_abandon(stk, abandon):
|
||||||
|
if abandon:
|
||||||
|
LOG.info('abandoning stack %s', stk.name)
|
||||||
|
stk.delete(abandon=abandon)
|
||||||
|
else:
|
||||||
|
LOG.info('exporting stack %s', stk.name)
|
||||||
|
|
||||||
st = self._get_stack(cnxt, stack_identity)
|
st = self._get_stack(cnxt, stack_identity)
|
||||||
stack = parser.Stack.load(cnxt, stack=st)
|
stack = parser.Stack.load(cnxt, stack=st)
|
||||||
lock = stack_lock.StackLock(cnxt, stack.id, self.engine_id)
|
lock = stack_lock.StackLock(cnxt, stack.id, self.engine_id)
|
||||||
with lock.thread_lock():
|
with lock.thread_lock():
|
||||||
# Get stack details before deleting it.
|
# Get stack details before deleting it.
|
||||||
stack_info = stack.prepare_abandon()
|
stack_info = stack.prepare_abandon()
|
||||||
if abandon:
|
|
||||||
LOG.info('abandoning stack %s', st.name)
|
|
||||||
self.thread_group_mgr.start_with_acquired_lock(stack,
|
self.thread_group_mgr.start_with_acquired_lock(stack,
|
||||||
lock,
|
lock,
|
||||||
stack.delete,
|
_stack_abandon,
|
||||||
abandon=True)
|
stack,
|
||||||
else:
|
abandon)
|
||||||
LOG.info('exporting stack %s', st.name)
|
|
||||||
return stack_info
|
return stack_info
|
||||||
|
|
||||||
def list_resource_types(self,
|
def list_resource_types(self,
|
||||||
|
Loading…
Reference in New Issue
Block a user