Skip to content

Commit 88c8e30

Browse files
authored
Merge pull request #170 from DMTF/Update-Timeout
Added '--timeout' option to rf_update.py to manually specify a timeout for the file transfer
2 parents 5218f06 + 9af461e commit 88c8e30

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

docs/rf_update.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ A tool to perform an update with a Redfish service.
1212
usage: rf_update.py [-h] --user USER --password PASSWORD --rhost RHOST --image
1313
IMAGE [--target TARGET]
1414
[--applytime {Immediate,OnReset,AtMaintenanceWindowStart,InMaintenanceWindowOnReset,OnStartUpdateRequest}]
15-
[--debug]
15+
[--timeout TIMEOUT] [--debug]
1616
1717
A tool to perform an update with a Redfish service
1818
@@ -31,6 +31,9 @@ optional arguments:
3131
The target resource to apply the image
3232
--applytime {Immediate,OnReset,AtMaintenanceWindowStart,InMaintenanceWindowOnReset,OnStartUpdateRequest}, -at {Immediate,OnReset,AtMaintenanceWindowStart,InMaintenanceWindowOnReset,OnStartUpdateRequest}
3333
The apply time for the update
34+
--timeout TIMEOUT, -timeout TIMEOUT
35+
The timeout, in seconds, to transfer the image; by
36+
default this is 2 seconds per MB
3437
--debug Creates debug file showing HTTP traces and exceptions
3538
```
3639

scripts/rf_update.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,7 @@ def print_error_payload(response):
9797
help="The apply time for the update",
9898
choices=redfish_utilities.operation_apply_times,
9999
)
100+
argget.add_argument("--timeout", "-timeout", type=int, help="The timeout, in seconds, to transfer the image; by default this is 2 seconds per MB")
100101
argget.add_argument("--debug", action="store_true", help="Creates debug file showing HTTP traces and exceptions")
101102
args = argget.parse_args()
102103

@@ -135,7 +136,7 @@ def print_error_payload(response):
135136
"Pushing the image to the service directly; depending on the size of the image, this can take a few minutes..."
136137
)
137138
response = redfish_utilities.multipart_push_update(
138-
redfish_obj, args.image, targets=targets, apply_time=args.applytime
139+
redfish_obj, args.image, targets=targets, timeout=args.timeout, apply_time=args.applytime
139140
)
140141
else:
141142
# Host a local web server and perform a SimpleUpdate for the local image

0 commit comments

Comments
 (0)