If you delete a heat stack using heat stack-delete of an existing bay, and then try to delete the bay:
[sdake@bigiron magnum]$ magnum bay-list
+--------------------------------------+------+------------+
| uuid | name | node_count |
+--------------------------------------+------+------------+
| e8fab2ce-73e9-472e-af8b-233c554eec25 | goof | 1 |
+--------------------------------------+------+------------+
[sdake@bigiron magnum]$ magnum bay-delete --id e8fab2ce-73e9-472e-af8b-233c554eec25
ERROR: Internal Server Error (HTTP 500)
The backtrace is as follows:
2015-01-18 09:54:47.229 25971 ERROR oslo.messaging._drivers.common [-] ['Traceback (most recent call last):\n', ' File "/usr/lib/python2.7/site-packages/oslo/messaging/rpc/dispatcher.py", line 138, in _dispatch_and_reply\n incoming.message))\n', ' File "/usr/lib/python2.7/site-packages/oslo/messaging/rpc/dispatcher.py", line 181, in _dispatch\n return self._do_dispatch(endpoint, method, ctxt, args)\n', ' File "/usr/lib/python2.7/site-packages/oslo/messaging/rpc/dispatcher.py", line 127, in _do_dispatch\n result = getattr(endpoint, method)(ctxt, **new_args)\n', ' File "/usr/lib/python2.7/site-packages/magnum/conductor/handlers/bay_k8s_heat.py", line 153, in bay_delete\n osc.heat().stacks.delete(stack_id)\n', ' File "/usr/lib/python2.7/site-packages/heatclient/v1/stacks.py", line 131, in delete\n self._delete("/stacks/%s" % stack_id)\n', ' File "/usr/lib/python2.7/site-packages/heatclient/openstack/common/apiclient/base.py", line 202, in _delete\n return self.client.delete(url)\n', ' File "/usr/lib/python2.7/site-packages/heatclient/common/http.py", line 289, in delete\n return self.raw_request("DELETE", url, **kwargs)\n', ' File "/usr/lib/python2.7/site-packages/heatclient/common/http.py", line 270, in raw_request\n return self._http_request(url, method, **kwargs)\n', ' File "/usr/lib/python2.7/site-packages/heatclient/common/http.py", line 216, in _http_request\n resp = self._http_request(path, method, **kwargs)\n', ' File "/usr/lib/python2.7/site-packages/heatclient/common/http.py", line 209, in _http_request\n raise exc.from_response(resp)\n', 'HTTPNotFound: ERROR: The Stack (goof) could not be found.\n']
This prevents the bay from ever being deletable!
The correct behavior in this scenario is to delete the bay and all of its contained pods, services, rcs that are stored on the bay since the stack is long gone when the Heat client raises a HTTPNotFound exception.
Fix proposed to branch: master /review. openstack. org/148142
Review: https:/