mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
More PEP8 fixes
Not sure why it missed those.
This commit is contained in:
parent
63c6afeaee
commit
2392934f48
1 changed files with 3 additions and 3 deletions
|
@ -83,7 +83,7 @@ class CallbackModule(CallbackBase):
|
||||||
return '%s: %s' % (failtype, multiline.strip('\r\n').splitlines()[linenr])
|
return '%s: %s' % (failtype, multiline.strip('\r\n').splitlines()[linenr])
|
||||||
|
|
||||||
def indent(self, multiline, indent=8):
|
def indent(self, multiline, indent=8):
|
||||||
return re.sub('^', ' '*indent, multiline, flags=re.MULTILINE)
|
return re.sub('^', ' ' * indent, multiline, flags=re.MULTILINE)
|
||||||
|
|
||||||
def body_blob(self, multiline, texttype):
|
def body_blob(self, multiline, texttype):
|
||||||
''' Turn some text output in a well-indented block for sending in a mail body '''
|
''' Turn some text output in a well-indented block for sending in a mail body '''
|
||||||
|
@ -148,10 +148,10 @@ class CallbackModule(CallbackBase):
|
||||||
body += self.body_blob(result._result['stderr'], 'error output')
|
body += self.body_blob(result._result['stderr'], 'error output')
|
||||||
if result._result.get('warnings'):
|
if result._result.get('warnings'):
|
||||||
for i in range(len(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'):
|
if result._result.get('deprecations'):
|
||||||
for i in range(len(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 += 'and a complete dump of the error:\n\n'
|
||||||
body += self.indent('%s: %s' % (failtype, json.dumps(result._result, indent=4)))
|
body += self.indent('%s: %s' % (failtype, json.dumps(result._result, indent=4)))
|
||||||
|
|
Loading…
Reference in a new issue