Don't log shell warning if output_loglevel is quiet

This will prevent grains generation from logging a bunch of these sort
of warnings.
This commit is contained in:
Erik Johnson 2019-02-04 09:57:09 -06:00
parent 1f6da6a2b7
commit 550e9abfe7
No known key found for this signature in database
GPG key ID: 5E5583C437808F3F

View file

@ -280,7 +280,7 @@ def _run(cmd,
'''
if 'pillar' in kwargs and not pillar_override:
pillar_override = kwargs['pillar']
if _is_valid_shell(shell) is False:
if output_loglevel != 'quiet' and _is_valid_shell(shell) is False:
log.warning(
'Attempt to run a shell command with what may be an invalid shell! '
'Check to ensure that the shell <%s> is valid for this user.',