Merge "Allow resource_by_refid returning resumed resources"
This commit is contained in:
commit
cf38339328
@ -260,6 +260,8 @@ class Stack(object):
|
||||
if r.state in (
|
||||
(r.CREATE, r.IN_PROGRESS),
|
||||
(r.CREATE, r.COMPLETE),
|
||||
(r.RESUME, r.IN_PROGRESS),
|
||||
(r.RESUME, r.COMPLETE),
|
||||
(r.UPDATE, r.IN_PROGRESS),
|
||||
(r.UPDATE, r.COMPLETE)) and r.FnGetRefId() == refid:
|
||||
return r
|
||||
|
@ -967,6 +967,15 @@ class StackTest(HeatTestCase):
|
||||
rsrc = self.stack['AResource']
|
||||
rsrc.resource_id_set('aaaa')
|
||||
self.assertNotEqual(None, resource)
|
||||
|
||||
for action, status in (
|
||||
(rsrc.CREATE, rsrc.IN_PROGRESS),
|
||||
(rsrc.CREATE, rsrc.COMPLETE),
|
||||
(rsrc.RESUME, rsrc.IN_PROGRESS),
|
||||
(rsrc.RESUME, rsrc.COMPLETE),
|
||||
(rsrc.UPDATE, rsrc.IN_PROGRESS),
|
||||
(rsrc.UPDATE, rsrc.COMPLETE)):
|
||||
rsrc.state_set(action, status)
|
||||
self.assertEqual(rsrc, self.stack.resource_by_refid('aaaa'))
|
||||
|
||||
rsrc.state_set(rsrc.DELETE, rsrc.IN_PROGRESS)
|
||||
|
Loading…
Reference in New Issue
Block a user