Browse Source

Merge "Fix SoftwareDeployment on DELETE action"

changes/67/645467/1
Zuul 3 years ago committed by Gerrit Code Review
parent
commit
7b156dd846
  1. 10
      heat/engine/stack.py

10
heat/engine/stack.py

@ -823,11 +823,11 @@ class Stack(collections.Mapping):
def access_allowed(self, credential_id, resource_name):
"""Is credential_id authorised to access resource by resource_name."""
if not self.resources:
# this also triggers lazy-loading of resources
# so is required for register_access_allowed_handler
# to be called
return False
if not self.resources or resource_name not in self.resources:
# this handle the case that sd in action delete,
# try to load access_allowed_handlers if resources object
# haven't been loaded.
[res.name for res in self.iter_resources()]
handler = self._access_allowed_handlers.get(credential_id)
return handler and handler(resource_name)

Loading…
Cancel
Save