idrac 0.9.8 → 0.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/idrac/firmware.rb +38 -31
- data/lib/idrac/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: ed5ada7ae018807e7dfc073f096fca65c1721b02698a27ae8253c4fe0ea7a999
|
|
4
|
+
data.tar.gz: 9463bffbbc3915cad87522b36ff9e29ef795e8e90ed0cffaed1912f0a7bb67ac
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 7072b7e0ac5d30a9bdef4bf88b4b9f09054343196eb4021b5318ee26baa7abb026e72662b3740cdd68ac5cb110911715fde1bbe02b430e0f07eab50a0a303cb4
|
|
7
|
+
data.tar.gz: 56ed519ae70e0786d6d1c26a2596cea0a8d8cec9c8b1aafbf4686d75c5c8cde39da0add93dabd518ddffe4e0ac6b3a736b0fcd35669f3d2296a5a79024520d3e
|
data/lib/idrac/firmware.rb
CHANGED
|
@@ -493,7 +493,9 @@ module IDRAC
|
|
|
493
493
|
:post,
|
|
494
494
|
http_push_uri,
|
|
495
495
|
headers: headers,
|
|
496
|
-
body: payload
|
|
496
|
+
body: payload,
|
|
497
|
+
timeout: 3600, # firmware uploads can take 30-60min on iDRAC8
|
|
498
|
+
open_timeout: 60
|
|
497
499
|
)
|
|
498
500
|
|
|
499
501
|
if upload_response.status != 201 && upload_response.status != 200
|
|
@@ -530,39 +532,44 @@ module IDRAC
|
|
|
530
532
|
# We'll try to continue with the SimpleUpdate action anyway
|
|
531
533
|
end
|
|
532
534
|
|
|
533
|
-
#
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
# Construct the image URI
|
|
537
|
-
image_uri = nil
|
|
538
|
-
|
|
539
|
-
if firmware_id
|
|
540
|
-
image_uri = "#{http_push_uri}/#{firmware_id}"
|
|
535
|
+
# Construct the firmware URI from the upload response
|
|
536
|
+
image_uri = if firmware_id
|
|
537
|
+
"#{http_push_uri}/#{firmware_id}"
|
|
541
538
|
else
|
|
542
|
-
|
|
543
|
-
image_uri = upload_response.headers['Location']
|
|
539
|
+
upload_response.headers['Location'] || http_push_uri
|
|
544
540
|
end
|
|
545
|
-
|
|
546
|
-
#
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
541
|
+
|
|
542
|
+
# Check if Dell OEM Install action is available (iDRAC8)
|
|
543
|
+
# This is more reliable than SimpleUpdate on older iDRACs
|
|
544
|
+
dell_install_target = update_service.dig("Actions", "Oem",
|
|
545
|
+
"DellUpdateService.v1_0_0#DellUpdateService.Install", "target")
|
|
546
|
+
|
|
547
|
+
if dell_install_target
|
|
548
|
+
puts "Using Dell OEM Install action (iDRAC8)...".light_cyan
|
|
549
|
+
puts "Firmware URI: #{image_uri}".light_cyan
|
|
550
|
+
install_payload = {
|
|
551
|
+
"SoftwareIdentityURIs" => [image_uri],
|
|
552
|
+
"InstallUpon" => "Now"
|
|
553
|
+
}
|
|
554
|
+
update_response = client.authenticated_request(
|
|
555
|
+
:post,
|
|
556
|
+
dell_install_target,
|
|
557
|
+
body: install_payload.to_json
|
|
558
|
+
)
|
|
559
|
+
else
|
|
560
|
+
puts "Using SimpleUpdate action...".light_cyan
|
|
561
|
+
puts "ImageURI: #{image_uri}".light_cyan
|
|
562
|
+
simple_update_payload = {
|
|
563
|
+
"ImageURI" => image_uri,
|
|
564
|
+
"TransferProtocol" => "HTTP"
|
|
565
|
+
}
|
|
566
|
+
update_response = client.authenticated_request(
|
|
567
|
+
:post,
|
|
568
|
+
"/redfish/v1/UpdateService/Actions/UpdateService.SimpleUpdate",
|
|
569
|
+
body: simple_update_payload.to_json
|
|
570
|
+
)
|
|
550
571
|
end
|
|
551
|
-
|
|
552
|
-
puts "Using ImageURI: #{image_uri}".light_cyan
|
|
553
|
-
|
|
554
|
-
# Initiate the SimpleUpdate action
|
|
555
|
-
simple_update_payload = {
|
|
556
|
-
"ImageURI" => image_uri,
|
|
557
|
-
"TransferProtocol" => "HTTP"
|
|
558
|
-
}
|
|
559
|
-
|
|
560
|
-
update_response = client.authenticated_request(
|
|
561
|
-
:post,
|
|
562
|
-
"/redfish/v1/UpdateService/Actions/UpdateService.SimpleUpdate",
|
|
563
|
-
body: simple_update_payload.to_json
|
|
564
|
-
)
|
|
565
|
-
|
|
572
|
+
|
|
566
573
|
if update_response.status != 202 && update_response.status != 200
|
|
567
574
|
puts "Failed to initiate firmware update: #{update_response.status} - #{update_response.body}".red
|
|
568
575
|
raise Error, "Failed to initiate firmware update: #{update_response.status} - #{update_response.body}"
|
data/lib/idrac/version.rb
CHANGED