idrac 0.5.1 → 0.5.2
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/bin/idrac +4 -4
- data/lib/idrac/license.rb +6 -6
- 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: e1bffe050d6256766e75d7a51d80133d14c3b86abcfc53b1de4e172be80f4747
|
4
|
+
data.tar.gz: c74c883203a6b14e2f18041c7df0e4dacae125cbf6f6cc6a3da2a0dd1bc56ef6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: db7644ef1fd92b3af97d0c202d5e3b6d80963bb5ecbe24b4a339249184c29667e7e0dea3f7e99074afaa52af127ef249c9768cf322156a12769a230d7cee7b76
|
7
|
+
data.tar.gz: 63e817a2e85d68f3c848658adefe7567ebd629546b15362d7ac32c9cb19aea4edd54f5091bf893f38a8f52c84eaa9c6ffda07b71fb4abc8872fde4bf74959961
|
data/bin/idrac
CHANGED
@@ -463,11 +463,11 @@ module IDRAC
|
|
463
463
|
license = client.license_info
|
464
464
|
if license
|
465
465
|
puts "\nLicense Information:".green.bold
|
466
|
-
puts "Description: #{license
|
467
|
-
puts "License Type: #{license
|
466
|
+
puts "Description: #{license.Description}".cyan
|
467
|
+
puts "License Type: #{license.LicenseType}".cyan
|
468
468
|
puts "License Version: #{client.license_version || 'Unknown'}".cyan
|
469
|
-
puts "Removable: #{license
|
470
|
-
puts "Status: #{license
|
469
|
+
puts "Removable: #{license.Removable}".cyan
|
470
|
+
puts "Status: #{license&.Status&.Health || 'Unknown'}".cyan
|
471
471
|
else
|
472
472
|
puts "No license information available".yellow
|
473
473
|
end
|
data/lib/idrac/license.rb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
module IDRAC
|
2
2
|
module License
|
3
3
|
# Gets the license information from the iDRAC
|
4
|
-
# @return [
|
4
|
+
# @return [RecursiveOpenStruct] License details
|
5
5
|
def license_info
|
6
6
|
response = authenticated_request(:get, "/redfish/v1/LicenseService/Licenses")
|
7
7
|
if response.status != 200
|
@@ -32,7 +32,7 @@ module IDRAC
|
|
32
32
|
license_details = JSON.parse(license_response.body)
|
33
33
|
debug "License details: #{license_details}", 2
|
34
34
|
|
35
|
-
return license_details
|
35
|
+
return RecursiveOpenStruct.new(license_details, recurse_over_arrays: true)
|
36
36
|
end
|
37
37
|
|
38
38
|
# Extracts the iDRAC version from the license description
|
@@ -43,15 +43,15 @@ module IDRAC
|
|
43
43
|
|
44
44
|
# Check the Description field, which often contains the version
|
45
45
|
# Example: "iDRAC9 Enterprise License"
|
46
|
-
if license
|
47
|
-
version = license
|
46
|
+
if license.Description && license.Description.match(/iDRAC(\d+)/i)
|
47
|
+
version = license.Description.match(/iDRAC(\d+)/i)[1].to_i
|
48
48
|
debug "Found license version from Description: #{version}", 1
|
49
49
|
return version
|
50
50
|
end
|
51
51
|
|
52
52
|
# Try alternative fields if Description didn't work
|
53
|
-
if license
|
54
|
-
version = license
|
53
|
+
if license.Name && license.Name.match(/iDRAC(\d+)/i)
|
54
|
+
version = license.Name.match(/iDRAC(\d+)/i)[1].to_i
|
55
55
|
debug "Found license version from Name: #{version}", 1
|
56
56
|
return version
|
57
57
|
end
|
data/lib/idrac/version.rb
CHANGED