From 9af461eba859204989c2fd68992c1e7aaf526efc Mon Sep 17 00:00:00 2001 From: Mike Raineri Date: Thu, 24 Oct 2024 13:37:21 -0400 Subject: [PATCH] Added '--timeout' option to rf_update.py to manually specify a timeout for the file transfer Signed-off-by: Mike Raineri --- docs/rf_update.md | 5 ++++- scripts/rf_update.py | 3 ++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/docs/rf_update.md b/docs/rf_update.md index 890b3a6..9d6dd76 100644 --- a/docs/rf_update.md +++ b/docs/rf_update.md @@ -12,7 +12,7 @@ A tool to perform an update with a Redfish service. usage: rf_update.py [-h] --user USER --password PASSWORD --rhost RHOST --image IMAGE [--target TARGET] [--applytime {Immediate,OnReset,AtMaintenanceWindowStart,InMaintenanceWindowOnReset,OnStartUpdateRequest}] - [--debug] + [--timeout TIMEOUT] [--debug] A tool to perform an update with a Redfish service @@ -31,6 +31,9 @@ optional arguments: The target resource to apply the image --applytime {Immediate,OnReset,AtMaintenanceWindowStart,InMaintenanceWindowOnReset,OnStartUpdateRequest}, -at {Immediate,OnReset,AtMaintenanceWindowStart,InMaintenanceWindowOnReset,OnStartUpdateRequest} The apply time for the update + --timeout TIMEOUT, -timeout TIMEOUT + The timeout, in seconds, to transfer the image; by + default this is 2 seconds per MB --debug Creates debug file showing HTTP traces and exceptions ``` diff --git a/scripts/rf_update.py b/scripts/rf_update.py index dbc4b6d..0fa1a1e 100644 --- a/scripts/rf_update.py +++ b/scripts/rf_update.py @@ -97,6 +97,7 @@ def print_error_payload(response): help="The apply time for the update", choices=redfish_utilities.operation_apply_times, ) +argget.add_argument("--timeout", "-timeout", type=int, help="The timeout, in seconds, to transfer the image; by default this is 2 seconds per MB") argget.add_argument("--debug", action="store_true", help="Creates debug file showing HTTP traces and exceptions") args = argget.parse_args() @@ -135,7 +136,7 @@ def print_error_payload(response): "Pushing the image to the service directly; depending on the size of the image, this can take a few minutes..." ) response = redfish_utilities.multipart_push_update( - redfish_obj, args.image, targets=targets, apply_time=args.applytime + redfish_obj, args.image, targets=targets, timeout=args.timeout, apply_time=args.applytime ) else: # Host a local web server and perform a SimpleUpdate for the local image