idrac 0.1.23 → 0.1.24

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: 19bd4d4dbb2b3c79b0b35e70067284d0b6c38dd548f37eabe2b1102b11dd8782
4
- data.tar.gz: 0555e28ccfedbbdfe5e100c23700ae2dc8cab849b806baf739de7a1d6fbd6d66
3
+ metadata.gz: f2e790b22ca375a798916fdb6d908583d2fa4823e90a814c2e7c27796c7b6351
4
+ data.tar.gz: 0ab7103ae540892dc959d22c7fa646050fe8eeaf003f6dc538c753fc3d614452
5
5
  SHA512:
6
- metadata.gz: dec9acadc7a50d101322f111b4522aa886547c92e8c8d089a7811527e4be43227c7116c62b9c2b199424427ecb95ea75604160f5d728142fe14d5c78302668f0
7
- data.tar.gz: 82b726d07aa328830a9a58292542712b0075b2865de7df56a1a2f161094a50762aed2b2f3aab80e835474f729a2ebbc131b452467607cbcb2bbcb70345baf61b
6
+ metadata.gz: 89b75cdaf04c90368379af12884e55dcd4e5daa52ccda59143776934c871a60c039891a13194a52496532159bad0859f3b8502fe2f8beeaf433319ba1d5aa0e1
7
+ data.tar.gz: 6dee9f26c047f9931ea846e2eaf738f91510801fdb090c384d18fd76639ca098db11ca071acb55ab81a0c319bb42ecb781d33f71ed83c66c9dac22c58c8bf2c6
data/README.md CHANGED
@@ -127,6 +127,14 @@ To install this gem onto your local machine, run `bundle exec rake install`. To
127
127
 
128
128
  ## Changelog
129
129
 
130
+ ### Version 0.1.24
131
+ - **Improved Firmware Update Check**: Fixed issues with firmware version comparison
132
+ - Eliminated duplicate entries in firmware update results
133
+ - Improved matching logic between installed firmware and catalog entries
134
+ - Added proper handling of BIOS updates
135
+ - Fixed missing version information in update output
136
+ - Enhanced name comparison with case-insensitive matching
137
+
130
138
  ### Version 0.1.23
131
139
  - **Fixed Duplicate Messages**: Removed duplicate "Retrieving system inventory..." message in firmware:status command
132
140
  - The message was appearing twice because it was being printed by both the CLI class and the Firmware class
@@ -153,7 +153,12 @@ module IDRAC
153
153
  # Get current firmware versions
154
154
  current_versions = {}
155
155
  inventory[:firmware].each do |fw|
156
- current_versions[fw[:name]] = fw[:version]
156
+ # Use the ID as the key to avoid duplicates
157
+ current_versions[fw[:id]] = {
158
+ name: fw[:name],
159
+ version: fw[:version],
160
+ updateable: fw[:updateable]
161
+ }
157
162
  end
158
163
 
159
164
  # Find matching components in catalog
@@ -163,21 +168,37 @@ module IDRAC
163
168
  path = component.at_xpath('Path')&.text
164
169
  component_type = component.at_xpath('ComponentType')&.text
165
170
 
171
+ next unless name && version && path # Skip if missing essential data
172
+
166
173
  # Check if this component matches any of our firmware
167
- inventory[:firmware].each do |fw|
168
- if fw[:name].include?(name) || name.include?(fw[:name])
169
- current_version = fw[:version]
174
+ # We'll track if we found a match to avoid duplicates
175
+ matched = false
176
+
177
+ current_versions.each do |id, fw_info|
178
+ # Normalize names for comparison
179
+ catalog_name = name.downcase.strip
180
+ firmware_name = fw_info[:name].downcase.strip
181
+
182
+ # Check if names match or contain each other
183
+ if catalog_name.include?(firmware_name) || firmware_name.include?(catalog_name) ||
184
+ (catalog_name.include?("bios") && firmware_name.include?("bios"))
185
+
186
+ # Skip if already matched to avoid duplicates
187
+ next if matched
170
188
 
171
- # Simple version comparison (this could be improved)
172
- if version != current_version
189
+ # Compare versions
190
+ if version != fw_info[:version] && fw_info[:updateable]
173
191
  updates << {
174
192
  name: name,
175
- current_version: current_version,
193
+ current_version: fw_info[:version],
176
194
  available_version: version,
177
195
  path: path,
178
196
  component_type: component_type,
179
197
  download_url: "https://downloads.dell.com/#{path}"
180
198
  }
199
+
200
+ # Mark as matched to avoid duplicates
201
+ matched = true
181
202
  end
182
203
  end
183
204
  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.1.23"
4
+ VERSION = "0.1.24"
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.1.23
4
+ version: 0.1.24
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jonathan Siegel