mirror of
https://github.com/valitydev/salt.git
synced 2024-11-07 17:09:03 +00:00
Catch pipe errors
This commit is contained in:
parent
b4dab551d0
commit
bc4b415da6
@ -3,6 +3,8 @@ Used to manage the outputter system. This package is the modular system used
|
||||
for managing outputters.
|
||||
'''
|
||||
|
||||
import errno
|
||||
|
||||
# Import salt libs
|
||||
import salt.loader
|
||||
|
||||
@ -23,7 +25,12 @@ def display_output(data, out, opts=None):
|
||||
print(get_printout(out, opts)(data).rstrip())
|
||||
except Exception:
|
||||
opts.pop('output', None)
|
||||
print(get_printout('nested', opts)(data).rstrip())
|
||||
try:
|
||||
print(get_printout('nested', opts)(data).rstrip())
|
||||
except IOError as e:
|
||||
# Only raise if it's NOT a broken pipe
|
||||
if e.errno != errno.EPIPE:
|
||||
raise e
|
||||
|
||||
|
||||
def get_printout(out, opts=None, **kwargs):
|
||||
|
Loading…
Reference in New Issue
Block a user