Skip to content

Commit

Permalink
Merge pull request #170 from DMTF/Update-Timeout
Browse files Browse the repository at this point in the history
Added '--timeout' option to rf_update.py to manually specify a timeout for the file transfer
  • Loading branch information
mraineri authored Oct 25, 2024
2 parents 5218f06 + 9af461e commit 88c8e30
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
5 changes: 4 additions & 1 deletion docs/rf_update.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
```

Expand Down
3 changes: 2 additions & 1 deletion scripts/rf_update.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 88c8e30

Please sign in to comment.