Merge "Fail fast if Resource action methods are missing"

This commit is contained in:
Jenkins 2013-08-12 15:41:29 +00:00 committed by Gerrit Code Review
commit 499ef45720
1 changed files with 3 additions and 7 deletions

View File

@ -333,13 +333,9 @@ class Stack(object):
def resource_action(r):
# Find e.g resource.create and call it
action_l = action.lower()
handle = getattr(r, '%s' % action_l, None)
if callable(handle):
return handle()
else:
raise exception.ResourceFailure(
AttributeError(_('Resource action %s not found') %
action_l), r)
handle = getattr(r, '%s' % action_l)
return handle()
action_task = scheduler.DependencyTaskGroup(self.dependencies,
resource_action,