Skip to content

Commit

Permalink
Fixed change that was added for protecting from BrokenPipeError excep…
Browse files Browse the repository at this point in the history
…tions to not crash on Windows

Signed-off-by: Mike Raineri <[email protected]>
  • Loading branch information
mraineri committed Jun 7, 2024
1 parent 525caa9 commit 64bc42a
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions scripts/rf_logs.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
import redfish_utilities
import traceback
import sys
from signal import signal, SIGPIPE, SIG_DFL
from redfish.messages import RedfishPasswordChangeRequiredError

# Get the input arguments
Expand Down Expand Up @@ -88,7 +87,12 @@
else:
# Print log was requested
log_entries = redfish_utilities.get_log_entries(redfish_obj, container_type, container_id, args.log)
signal(SIGPIPE, SIG_DFL)
try:
from signal import signal, SIGPIPE, SIG_DFL
signal(SIGPIPE, SIG_DFL)
except:
# Windows does not support SIGPIPE; no need to modify the handling
pass
redfish_utilities.print_log_entries(log_entries, args.details)
except Exception as e:
if args.debug:
Expand Down

0 comments on commit 64bc42a

Please sign in to comment.