idrac 0.11.0 → 0.11.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/README.md +13 -0
- data/lib/idrac/utility.rb +42 -5
- data/lib/idrac/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: f24b2229f786a83cbdcaf74c4511953d92b4081194aec3885e825a83426a8ff7
|
|
4
|
+
data.tar.gz: d5b0b13b8f51b43936e01601e031617b2704bd5d09b4fffcb8c99f35864fe130
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 3d71bfb2ca893fed352c34c4726a9c76bee97c9978933f3d0928e48f8ba4a0a12fe5b3045fdc3f7a33c8ab107156e6b71d14275ca377fb93fb146a64f7be6525
|
|
7
|
+
data.tar.gz: aca2e4227201a36da2f657bfacbe2109c95ae63ddccca6a85f3c1aee84f08180987cf1b50e9f623214466c6d46701920f56a2182a74ba2616e61bfa263614b04
|
data/README.md
CHANGED
|
@@ -36,6 +36,19 @@ Or install it yourself as:
|
|
|
36
36
|
|
|
37
37
|
$ gem install idrac
|
|
38
38
|
|
|
39
|
+
## Compatibility
|
|
40
|
+
|
|
41
|
+
`activesupport` below 8.1 and `json` 3 cannot be used together: activesupport's
|
|
42
|
+
JSON encoder calls `JSON.generate(..., quirks_mode: true)`, and json 3 removed
|
|
43
|
+
that keyword, so any `hash.to_json` raises `ArgumentError: unknown keyword:
|
|
44
|
+
quirks_mode`. This is not specific to this gem — it bites anything that loads
|
|
45
|
+
`active_support/core_ext` — but idrac depends on activesupport, so pick one of:
|
|
46
|
+
|
|
47
|
+
- activesupport >= 8.1 with json 3, or
|
|
48
|
+
- activesupport 7.x with json 2.
|
|
49
|
+
|
|
50
|
+
CI covers both ends.
|
|
51
|
+
|
|
39
52
|
## Usage
|
|
40
53
|
|
|
41
54
|
### Command Line Interface
|
data/lib/idrac/utility.rb
CHANGED
|
@@ -194,11 +194,28 @@ module IDRAC
|
|
|
194
194
|
# @param data_selector_values [Array] Array of log types to include (optional)
|
|
195
195
|
# @param wait_timeout [Integer] Maximum time to wait for generation in seconds (default: 600)
|
|
196
196
|
# @return [String, nil] Path to downloaded file or nil if failed
|
|
197
|
-
def generate_and_download_tsr(output_file: nil, data_selector_values: nil, wait_timeout: 600)
|
|
197
|
+
def generate_and_download_tsr(output_file: nil, data_selector_values: nil, accept_eula: false, wait_timeout: 600)
|
|
198
198
|
debug "Starting TSR generation and download process...", 1
|
|
199
|
-
|
|
199
|
+
|
|
200
200
|
output_file ||= "supportassist_#{@host}_#{Time.now.strftime('%Y%m%d_%H%M%S')}.zip"
|
|
201
|
-
|
|
201
|
+
|
|
202
|
+
# Accept the EULA up front when asked -- generate_tsr_logs only errors out otherwise.
|
|
203
|
+
accept_supportassist_eula if accept_eula
|
|
204
|
+
|
|
205
|
+
# Wait out a collection that is still running server-side. The iDRAC allows only one
|
|
206
|
+
# SupportAssist collection at a time, so generating now would fail with "a SupportAssist job
|
|
207
|
+
# is already running". Give up after wait_timeout seconds and fail the same way the rest of
|
|
208
|
+
# this method does (return nil).
|
|
209
|
+
wait_deadline = Time.now + wait_timeout
|
|
210
|
+
while supportassist_collection_running?
|
|
211
|
+
if Time.now > wait_deadline
|
|
212
|
+
debug "Timed out after #{wait_timeout}s waiting for a running SupportAssist collection to finish", 1, :red
|
|
213
|
+
return nil
|
|
214
|
+
end
|
|
215
|
+
debug "A SupportAssist collection is already running; waiting...", 1, :yellow
|
|
216
|
+
sleep 15
|
|
217
|
+
end
|
|
218
|
+
|
|
202
219
|
# First, generate the TSR
|
|
203
220
|
result = generate_tsr_logs(data_selector_values: data_selector_values)
|
|
204
221
|
|
|
@@ -267,8 +284,9 @@ module IDRAC
|
|
|
267
284
|
collection_in_progress: false
|
|
268
285
|
}
|
|
269
286
|
|
|
270
|
-
# Check if there's an active collection job
|
|
271
|
-
|
|
287
|
+
# Check if there's an active collection job. The list must be expanded, otherwise each
|
|
288
|
+
# Members entry is a bare @odata.id with no Name/JobState and the check never fires.
|
|
289
|
+
jobs_response = authenticated_request(:get, "/redfish/v1/Managers/iDRAC.Embedded.1/Jobs?$expand=*($levels=1)")
|
|
272
290
|
if jobs_response.status == 200
|
|
273
291
|
jobs_data = JSON.parse(jobs_response.body)
|
|
274
292
|
if jobs_data["Members"]
|
|
@@ -294,6 +312,25 @@ module IDRAC
|
|
|
294
312
|
{ available: false, error: e.message }
|
|
295
313
|
end
|
|
296
314
|
|
|
315
|
+
# True when a SupportAssist Collection job is still running server-side. Reads the expanded Dell
|
|
316
|
+
# Jobs list (bare @odata.id members carry no Name/JobState) and treats a job as running when its
|
|
317
|
+
# Name matches SupportAssist Collection, its JobState is not terminal, and it is below 100%.
|
|
318
|
+
# Use this to wait out a prior collection before starting a new one (the iDRAC allows only one).
|
|
319
|
+
def supportassist_collection_running?
|
|
320
|
+
response = authenticated_request(:get, "/redfish/v1/Managers/iDRAC.Embedded.1/Jobs?$expand=*($levels=1)")
|
|
321
|
+
return false unless response.status == 200
|
|
322
|
+
|
|
323
|
+
members = JSON.parse(response.body)["Members"] || []
|
|
324
|
+
members.any? do |job|
|
|
325
|
+
job["Name"].to_s =~ /SupportAssist Collection/i &&
|
|
326
|
+
!IDRAC::Firmware::TERMINAL_JOB_STATES.include?(job["JobState"]) &&
|
|
327
|
+
job["PercentComplete"].to_i < 100
|
|
328
|
+
end
|
|
329
|
+
rescue => e
|
|
330
|
+
debug "Error checking SupportAssist collection state: #{e.message}", 1, :red
|
|
331
|
+
false
|
|
332
|
+
end
|
|
333
|
+
|
|
297
334
|
# Check SupportAssist EULA status
|
|
298
335
|
# @return [Hash] EULA status information
|
|
299
336
|
def supportassist_eula_status
|
data/lib/idrac/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: idrac
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.11.
|
|
4
|
+
version: 0.11.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Jonathan Siegel
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2026-
|
|
11
|
+
date: 2026-10-04 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: httparty
|