Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed change that was added for protecting from BrokenPipeError exceptions to not crash on Windows #161

Merged
merged 2 commits into from
Jun 7, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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