idrac 0.5.0 → 0.5.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 32086f37bcf1f9d8bfaf3bf5a54e4159cc2db5ed3b97bc5021203f266e62e7aa
4
- data.tar.gz: c107965b24d8edc018f44c42da5f6ddd978d978a4ed83eea51304e7b80dc5f40
3
+ metadata.gz: 75d31422362fd2d548fff6e03265162bdf4cfb34237085a7e9e14170bcd8d5eb
4
+ data.tar.gz: 219ca3faaaf4e3b8d85ceb0db0baebe5ffa81c2e5afc61ba13851c76fd1f6b41
5
5
  SHA512:
6
- metadata.gz: 45d74e3ba6b18f6a86e6f644932a20b4316814814a4c37961b54092f6bfe018bfbadc3d9cade70c160dd43c7adb80d7e86e30468e88152a32631b0883b94e09d
7
- data.tar.gz: b84528baa1d901c687107ea00dc08a1668ad5f60d258cbfb0f9fc69bcbe5efa6530d5c9c2614270f7c3044dd2cd99665168b7f6eadab53d2c4d7b17b1a88fb33
6
+ metadata.gz: b37b6e6094ee872b2989dcd4d66a8a965502ed7193a66813d5ed3ff60592cfae47c26f9caf9b2f0c34580d366845b49414f55bd909519618d8439cdb71fe8473
7
+ data.tar.gz: 30ffb9cbd571489a12f71c553777089541c3550287aca5a267bc4b964da41ff268219ca9e4306097c0aced7ae29a1bd7d17f6ccccfefd45f77778a29891801e1
data/bin/idrac CHANGED
@@ -906,13 +906,13 @@ module IDRAC
906
906
  puts "\nProcessor Summary:".green.bold
907
907
  puts "=" * 50
908
908
 
909
- health_color = cpus[:status] == "OK" ? :green : :red
909
+ health_color = cpus.status == "OK" ? :green : :red
910
910
 
911
- puts "Processor Model:".ljust(25) + cpus[:model].to_s.light_cyan
912
- puts "Processor Count:".ljust(25) + cpus[:count].to_s.light_cyan
913
- puts "Physical Cores:".ljust(25) + cpus[:cores].to_s.light_cyan
914
- puts "Logical Cores:".ljust(25) + cpus[:threads].to_s.light_cyan
915
- puts "Status:".ljust(25) + cpus[:status].to_s.send(health_color)
911
+ puts "Processor Model:".ljust(25) + cpus.model.to_s.light_cyan
912
+ puts "Processor Count:".ljust(25) + cpus.count.to_s.light_cyan
913
+ puts "Physical Cores:".ljust(25) + cpus.cores.to_s.light_cyan
914
+ puts "Logical Cores:".ljust(25) + cpus.threads.to_s.light_cyan
915
+ puts "Status:".ljust(25) + cpus.status.to_s.send(health_color)
916
916
 
917
917
  puts "=" * 50
918
918
  end
@@ -1164,16 +1164,16 @@ module IDRAC
1164
1164
  with_idrac_client do |client|
1165
1165
  info = client.system_info
1166
1166
 
1167
- if info[:is_dell]
1167
+ if info.is_dell
1168
1168
  puts "Dell iDRAC System:".green.bold
1169
- puts " Service Tag: #{info[:service_tag]}".cyan
1170
- puts " Model: #{info[:model]}".cyan
1171
- puts " iDRAC Version: #{info[:idrac_version]}".cyan
1172
- puts " Firmware Version: #{info[:firmware_version]}".cyan
1169
+ puts " Service Tag: #{info.service_tag}".cyan
1170
+ puts " Model: #{info.model}".cyan
1171
+ puts " iDRAC Version: #{info.idrac_version}".cyan
1172
+ puts " Firmware Version: #{info.firmware_version}".cyan
1173
1173
  else
1174
1174
  puts "Not a Dell iDRAC system".yellow
1175
- puts " Product: #{info[:product]}".cyan
1176
- if info[:is_ancient_dell]
1175
+ puts " Product: #{info.product}".cyan
1176
+ if info.is_ancient_dell
1177
1177
  puts " Ancient Dell System detected. Update firmware.".yellow
1178
1178
  end
1179
1179
  end
@@ -1204,17 +1204,17 @@ module IDRAC
1204
1204
  puts "=" * 50
1205
1205
 
1206
1206
  # Display overall health with color coding
1207
- overall_color = health[:overall] == "OK" ? :green : :red
1208
- system_color = health[:system] == "OK" ? :green : :red
1209
- processor_color = health[:processor] == "OK" ? :green : :red
1210
- memory_color = health[:memory] == "OK" ? :green : :red
1211
- storage_color = health[:storage] == "OK" ? :green : (health[:storage].nil? ? :yellow : :red)
1212
-
1213
- puts "Overall Health:".ljust(25) + health[:overall].to_s.send(overall_color)
1214
- puts "System Health:".ljust(25) + health[:system].to_s.send(system_color)
1215
- puts "Processor Health:".ljust(25) + health[:processor].to_s.send(processor_color)
1216
- puts "Memory Health:".ljust(25) + health[:memory].to_s.send(memory_color)
1217
- puts "Storage Health:".ljust(25) + (health[:storage] || "Unknown").to_s.send(storage_color)
1207
+ overall_color = health.overall == "OK" ? :green : :red
1208
+ system_color = health.system == "OK" ? :green : :red
1209
+ processor_color = health.processor == "OK" ? :green : :red
1210
+ memory_color = health.memory == "OK" ? :green : :red
1211
+ storage_color = health.storage == "OK" ? :green : (health.storage.nil? ? :yellow : :red)
1212
+
1213
+ puts "Overall Health:".ljust(25) + health.overall.to_s.send(overall_color)
1214
+ puts "System Health:".ljust(25) + health.system.to_s.send(system_color)
1215
+ puts "Processor Health:".ljust(25) + health.processor.to_s.send(processor_color)
1216
+ puts "Memory Health:".ljust(25) + health.memory.to_s.send(memory_color)
1217
+ puts "Storage Health:".ljust(25) + (health.storage || "Unknown").to_s.send(storage_color)
1218
1218
 
1219
1219
  puts "=" * 50
1220
1220
  end
data/lib/idrac/system.rb CHANGED
@@ -368,16 +368,16 @@ module IDRAC
368
368
  info[:model] = system_data["Model"]
369
369
  end
370
370
 
371
- return info
371
+ return RecursiveOpenStruct.new(info, recurse_over_arrays: true)
372
372
  else
373
373
  # Try to handle ancient Dell models where Product is null or non-standard
374
374
  if data["Product"].nil? || data.dig("Oem", "Dell")
375
375
  info[:is_ancient_dell] = true
376
- return info
376
+ return RecursiveOpenStruct.new(info, recurse_over_arrays: true)
377
377
  end
378
378
  end
379
379
 
380
- return info
380
+ return RecursiveOpenStruct.new(info, recurse_over_arrays: true)
381
381
  rescue JSON::ParserError
382
382
  raise Error, "Failed to parse system information: #{response.body}"
383
383
  end
@@ -402,7 +402,7 @@ module IDRAC
402
402
  status: data.dig("ProcessorSummary", "Status", "Health")
403
403
  }
404
404
 
405
- return summary
405
+ return RecursiveOpenStruct.new(summary, recurse_over_arrays: true)
406
406
  rescue JSON::ParserError
407
407
  raise Error, "Failed to parse processor information: #{response.body}"
408
408
  end
@@ -427,7 +427,7 @@ module IDRAC
427
427
  storage: data.dig("Storage", "Status", "Health")
428
428
  }
429
429
 
430
- return health
430
+ return RecursiveOpenStruct.new(health, recurse_over_arrays: true)
431
431
  rescue JSON::ParserError
432
432
  raise Error, "Failed to parse system health information: #{response.body}"
433
433
  end
data/lib/idrac/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module IDRAC
4
- VERSION = "0.5.0"
4
+ VERSION = "0.5.1"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: idrac
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.0
4
+ version: 0.5.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jonathan Siegel