mail: Fix cannot concatenate 'str' and 'int' objects

Fix an error in callback plugin when exceptions are being returned on failure.
This commit is contained in:
Dag Wieers 2018-02-19 20:39:25 +01:00 committed by GitHub
parent 5bc9bb9fbb
commit 3ce5261272
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -199,10 +199,10 @@ class CallbackModule(CallbackBase):
body += self.body_blob(result._result['stderr'], 'error output')
if result._result.get('warnings'):
for i in range(len(result._result.get('warnings'))):
body += self.body_blob(result._result['warnings'][i], 'exception %d' % i + 1)
body += self.body_blob(result._result['warnings'][i], 'exception %d' % (i + 1))
if result._result.get('deprecations'):
for i in range(len(result._result.get('deprecations'))):
body += self.body_blob(result._result['deprecations'][i], 'exception %d' % i + 1)
body += self.body_blob(result._result['deprecations'][i], 'exception %d' % (i + 1))
body += 'and a complete dump of the error:\n\n'
body += self.indent('%s: %s' % (failtype, json.dumps(result._result, indent=4)))