engine : Fix ResourceFailure exception issues
Fix some issues spotted in https://review.openstack.org/#/c/29543 These errors were spotted after the patch was merged, the ResourceFailure exception takes an Exception not string argument Change-Id: I72045ecf147c66a0a1cf1ef5df7fb3be8100384d
This commit is contained in:
parent
5b17402cb5
commit
8d549d0694
|
@ -406,8 +406,8 @@ class Stack(object):
|
|||
self.resources.itervalues())
|
||||
scheduler.TaskRunner(res.create)()
|
||||
else:
|
||||
raise exception.ResourceFailure(
|
||||
"Unexpected update retval %s" % retval)
|
||||
raise exception.ResourceFailure(ValueError(
|
||||
"Unexpected update retval %s" % retval))
|
||||
|
||||
if action == self.UPDATE:
|
||||
stack_status = self.UPDATE_COMPLETE
|
||||
|
|
|
@ -360,13 +360,11 @@ class Resource(object):
|
|||
update the resource. Subclasses should provide a handle_update() method
|
||||
to customise update, the base-class handle_update will fail by default.
|
||||
'''
|
||||
if self.state in (self.CREATE_IN_PROGRESS, self.UPDATE_IN_PROGRESS):
|
||||
raise exception.ResourceFailure(
|
||||
'Resource update already requested')
|
||||
assert json_snippet is not None, 'Must specify update json snippet'
|
||||
|
||||
if not json_snippet:
|
||||
raise exception.ResourceFailure(
|
||||
'Must specify json snippet for resource update!')
|
||||
if self.state in (self.CREATE_IN_PROGRESS, self.UPDATE_IN_PROGRESS):
|
||||
raise exception.ResourceFailure(Exception(
|
||||
'Resource update already requested'))
|
||||
|
||||
logger.info('updating %s' % str(self))
|
||||
|
||||
|
|
Loading…
Reference in New Issue