Log failed nova operations

* Log failed operations.
* Use string formatting and not append for building op.

Change-Id: I36cf7f819d5d2d61e9ed9b561d5bb48e1f2fa8a7
This commit is contained in:
Erik Olof Gunnar Andersson 2019-12-16 13:44:40 -08:00
parent 1e5e4dd8b4
commit e9b8cf4d47
1 changed files with 2 additions and 1 deletions

View File

@ -432,9 +432,10 @@ class Node(object):
try:
profile = self.rt['profile']
method = getattr(profile, 'handle_' + op)
method = getattr(profile, 'handle_%s' % op)
method(self, **params)
except exc.EResourceOperation as ex:
LOG.error('Node operation %s failed: %s.', op, ex)
self.set_status(context, consts.NS_ERROR, reason=six.text_type(ex))
return False