Skip to content

Commit

Permalink
Merge pull request #161 from DMTF/Signal-Exception-Windows
Browse files Browse the repository at this point in the history
Fixed change that was added for protecting from BrokenPipeError exceptions to not crash on Windows
  • Loading branch information
mraineri authored Jun 7, 2024
2 parents 525caa9 + d12ae5a commit def628a
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 Exception:
# 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 def628a

Please sign in to comment.