idrac 0.9.9 → 0.10.1
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 +35 -30
- data/lib/idrac/version.rb +1 -1
- data/lib/idrac/virtual_media.rb +27 -12
- metadata +6 -3
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 4faf659d1c3e461b586ef1201dae99bb8e82c099e68d153f1a10577bf9905aaa
|
|
4
|
+
data.tar.gz: 656f070d756624b34eb78579e2398084dfbf8e9cf6f2ebe85f42d930e505bdef
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 8e790bf89380f88a3a78f590287732aea452557b908fff4cd9ad2220f1f8d03efeada37536a04b3dfb61d6645e8c570c219098510504f1430cab8a1cb8a72b64
|
|
7
|
+
data.tar.gz: c67eca58928d95678a58fdd114f723f1178d0cfa6d311afb82c77e49edf3c754e2a6b7e865620ba2332c0fee19fef650a7e85817c7664667105a01c15eca9dd6
|
data/lib/idrac/firmware.rb
CHANGED
|
@@ -532,39 +532,44 @@ module IDRAC
|
|
|
532
532
|
# We'll try to continue with the SimpleUpdate action anyway
|
|
533
533
|
end
|
|
534
534
|
|
|
535
|
-
#
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
# Construct the image URI
|
|
539
|
-
image_uri = nil
|
|
540
|
-
|
|
541
|
-
if firmware_id
|
|
542
|
-
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}"
|
|
543
538
|
else
|
|
544
|
-
|
|
545
|
-
image_uri = upload_response.headers['Location']
|
|
539
|
+
upload_response.headers['Location'] || http_push_uri
|
|
546
540
|
end
|
|
547
|
-
|
|
548
|
-
#
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
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
|
+
)
|
|
552
571
|
end
|
|
553
|
-
|
|
554
|
-
puts "Using ImageURI: #{image_uri}".light_cyan
|
|
555
|
-
|
|
556
|
-
# Initiate the SimpleUpdate action
|
|
557
|
-
simple_update_payload = {
|
|
558
|
-
"ImageURI" => image_uri,
|
|
559
|
-
"TransferProtocol" => "HTTP"
|
|
560
|
-
}
|
|
561
|
-
|
|
562
|
-
update_response = client.authenticated_request(
|
|
563
|
-
:post,
|
|
564
|
-
"/redfish/v1/UpdateService/Actions/UpdateService.SimpleUpdate",
|
|
565
|
-
body: simple_update_payload.to_json
|
|
566
|
-
)
|
|
567
|
-
|
|
572
|
+
|
|
568
573
|
if update_response.status != 202 && update_response.status != 200
|
|
569
574
|
puts "Failed to initiate firmware update: #{update_response.status} - #{update_response.body}".red
|
|
570
575
|
raise Error, "Failed to initiate firmware update: #{update_response.status} - #{update_response.body}"
|
data/lib/idrac/version.rb
CHANGED
data/lib/idrac/virtual_media.rb
CHANGED
|
@@ -12,11 +12,18 @@ module IDRAC
|
|
|
12
12
|
data = JSON.parse(response.body)
|
|
13
13
|
|
|
14
14
|
media = data["Members"].map do |m|
|
|
15
|
-
#
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
15
|
+
# Trust the BMC's structured connection state when present; fall back to the
|
|
16
|
+
# Image/ImageName string only when it isn't. On iDRAC8 a slot can keep a stale
|
|
17
|
+
# Image string with nothing actually mounted (ConnectedVia == "NotConnected" /
|
|
18
|
+
# Inserted == false); treating that as "inserted" makes eject POST an EjectMedia
|
|
19
|
+
# the BMC rejects with HTTP 500 (VRM0009).
|
|
20
|
+
is_inserted = if !m["Inserted"].nil?
|
|
21
|
+
m["Inserted"]
|
|
22
|
+
elsif m["ConnectedVia"]
|
|
23
|
+
m["ConnectedVia"] != "NotConnected"
|
|
24
|
+
else
|
|
25
|
+
(m["Image"] && !m["Image"].empty?) || (m["ImageName"] && !m["ImageName"].empty?)
|
|
26
|
+
end
|
|
20
27
|
|
|
21
28
|
# Indicate which field is used for this iDRAC version and print it
|
|
22
29
|
puts "ImageName is used for this iDRAC version".yellow if m["ImageName"]
|
|
@@ -70,13 +77,21 @@ module IDRAC
|
|
|
70
77
|
"Managers/iDRAC.Embedded.1/VirtualMedia/#{device}/Actions/VirtualMedia.EjectMedia"
|
|
71
78
|
end
|
|
72
79
|
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
+
begin
|
|
81
|
+
response = authenticated_request(
|
|
82
|
+
:post,
|
|
83
|
+
"/redfish/v1/#{path}",
|
|
84
|
+
body: {}.to_json
|
|
85
|
+
)
|
|
86
|
+
response.status.between?(200, 299)
|
|
87
|
+
rescue IDRAC::Error => e
|
|
88
|
+
# iDRAC8 can still 500 with VRM0009 ("No Virtual Media devices are currently connected")
|
|
89
|
+
# when the slot reported a stale image but nothing was actually mounted. Ejecting nothing
|
|
90
|
+
# is a no-op success for callers, so swallow exactly that rejection.
|
|
91
|
+
raise unless e.message =~ /VRM0009|No Virtual Media devices are currently connected/i
|
|
92
|
+
puts "Nothing actually mounted on #{device}; treating eject as no-op".yellow
|
|
93
|
+
false
|
|
94
|
+
end
|
|
80
95
|
end
|
|
81
96
|
|
|
82
97
|
# Insert virtual media (ISO)
|
metadata
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: idrac
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.10.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Jonathan Siegel
|
|
8
|
+
autorequire:
|
|
8
9
|
bindir: bin
|
|
9
10
|
cert_chain: []
|
|
10
|
-
date:
|
|
11
|
+
date: 2026-06-02 00:00:00.000000000 Z
|
|
11
12
|
dependencies:
|
|
12
13
|
- !ruby/object:Gem::Dependency
|
|
13
14
|
name: httparty
|
|
@@ -281,6 +282,7 @@ licenses:
|
|
|
281
282
|
metadata:
|
|
282
283
|
homepage_uri: https://github.com/buildio/idrac
|
|
283
284
|
source_code_uri: https://github.com/buildio/idrac
|
|
285
|
+
post_install_message:
|
|
284
286
|
rdoc_options: []
|
|
285
287
|
require_paths:
|
|
286
288
|
- lib
|
|
@@ -295,7 +297,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
295
297
|
- !ruby/object:Gem::Version
|
|
296
298
|
version: '0'
|
|
297
299
|
requirements: []
|
|
298
|
-
rubygems_version: 3.
|
|
300
|
+
rubygems_version: 3.5.16
|
|
301
|
+
signing_key:
|
|
299
302
|
specification_version: 4
|
|
300
303
|
summary: API Client for Dell iDRAC
|
|
301
304
|
test_files: []
|