From 64bc42ab082783eb0dc3281797013abb80edf545 Mon Sep 17 00:00:00 2001 From: Mike Raineri Date: Fri, 7 Jun 2024 17:19:11 -0400 Subject: [PATCH] Fixed change that was added for protecting from BrokenPipeError exceptions to not crash on Windows Signed-off-by: Mike Raineri --- scripts/rf_logs.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/scripts/rf_logs.py b/scripts/rf_logs.py index 77a127f..8363dc8 100644 --- a/scripts/rf_logs.py +++ b/scripts/rf_logs.py @@ -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 @@ -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: