Don't store attributes if resource not stored

If stack-show is called at an inopportune moment in convergence, we can
attempt to store the attributes of a resource that isn't actually in the
database.  This causes occasional gate failures due to an assert.

Closes-Bug: #1701569
Change-Id: I50de08ae6b40958781ef4223c82a5c195b0757bf
This commit is contained in:
Thomas Herve 2017-06-30 14:18:45 +02:00
parent 53f53f83eb
commit fda92763c9
1 changed files with 2 additions and 1 deletions

View File

@ -539,7 +539,8 @@ class EngineService(service.ServiceBase):
for stack in stacks:
if stack.convergence:
for res in six.itervalues(stack.resources):
res.store_attributes()
if res.id is not None:
res.store_attributes()
return retval
def get_revision(self, cnxt):