Resource create/update/delete failures not always caught
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
OpenStack Heat |
Fix Released
|
High
|
Steven Hardy | ||
Grizzly |
Fix Released
|
High
|
Steven Hardy |
Bug Description
We have a (broken IMO) pattern where resource.create(), resource.update() and resource.delete() are treated as having failed if they return a value, e.g:
result = res.create()
if result:
stack_status = self.CREATE_FAILED
The problem is if any Exception gets raised without a string description we return an empty string, which is treated as if no error has occurred.
E.g try putting "raise Exception()" in any resource handle_create - result is an empty string so result is evaluated as False and the resource will not be set to CREATE_FAILED state.
The quick fix is to replace all the Exception-
return str(ex)
with:
return str(ex) or "Error : %s" % type(ex)
Or something similar, but longer term, I think we need to look at this pattern and replace it with re-raising an Exception so it can be caught e.g in parser.py instead of relying on the non-standard error-if-
Changed in heat: | |
status: | New → Triaged |
importance: | Undecided → High |
assignee: | nobody → Steven Hardy (shardy) |
description: | updated |
Changed in heat: | |
milestone: | none → grizzly-3 |
Changed in heat: | |
status: | Fix Committed → Fix Released |
Changed in heat: | |
milestone: | grizzly-3 → 2013.1 |
Fix proposed to branch: master /review. openstack. org/22336
Review: https:/