Don't display "None" in SaltInvocationError when Salt installed using -OO

When there is no docstring, just omit it from the return instead.
This commit is contained in:
Erik Johnson 2018-06-20 11:07:14 -05:00
parent 90c90f5d5c
commit fb237272f5
No known key found for this signature in database
GPG key ID: 5E5583C437808F3F

View file

@ -1528,7 +1528,9 @@ class Minion(MinionBase):
)
ret['out'] = 'nested'
except TypeError as exc:
msg = 'Passed invalid arguments to {0}: {1}\n{2}'.format(function_name, exc, func.__doc__, )
msg = 'Passed invalid arguments to {0}: {1}\n{2}'.format(
function_name, exc, func.__doc__ or ''
)
log.warning(msg, exc_info_on_loglevel=logging.DEBUG)
ret['return'] = msg
ret['out'] = 'nested'