idrac 0.1.31 → 0.1.40

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.
Files changed (44) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +49 -107
  3. data/bin/idrac +130 -15
  4. data/idrac.gemspec +9 -8
  5. data/lib/idrac/client.rb +22 -383
  6. data/lib/idrac/session.rb +278 -0
  7. data/lib/idrac/version.rb +1 -1
  8. data/lib/idrac/web.rb +187 -0
  9. data/lib/idrac.rb +3 -1
  10. metadata +7 -39
  11. data/.rspec +0 -3
  12. data/Rakefile +0 -17
  13. data/dell_firmware_downloads/Catalog.etag +0 -1
  14. data/dell_firmware_downloads/Catalog.xml +0 -0
  15. data/idrac-0.1.6/.rspec +0 -3
  16. data/idrac-0.1.6/README.md +0 -103
  17. data/idrac-0.1.6/Rakefile +0 -17
  18. data/idrac-0.1.6/bin/console +0 -11
  19. data/idrac-0.1.6/bin/idrac +0 -179
  20. data/idrac-0.1.6/bin/setup +0 -8
  21. data/idrac-0.1.6/idrac.gemspec +0 -51
  22. data/idrac-0.1.6/lib/idrac/client.rb +0 -109
  23. data/idrac-0.1.6/lib/idrac/firmware.rb +0 -366
  24. data/idrac-0.1.6/lib/idrac/version.rb +0 -5
  25. data/idrac-0.1.6/lib/idrac.rb +0 -30
  26. data/idrac-0.1.6/sig/idrac.rbs +0 -4
  27. data/idrac-0.1.7/.rspec +0 -3
  28. data/idrac-0.1.7/README.md +0 -103
  29. data/idrac-0.1.7/Rakefile +0 -17
  30. data/idrac-0.1.7/bin/console +0 -11
  31. data/idrac-0.1.7/bin/idrac +0 -179
  32. data/idrac-0.1.7/bin/setup +0 -8
  33. data/idrac-0.1.7/idrac.gemspec +0 -51
  34. data/idrac-0.1.7/lib/idrac/client.rb +0 -109
  35. data/idrac-0.1.7/lib/idrac/firmware.rb +0 -366
  36. data/idrac-0.1.7/lib/idrac/screenshot.rb +0 -49
  37. data/idrac-0.1.7/lib/idrac/version.rb +0 -5
  38. data/idrac-0.1.7/lib/idrac.rb +0 -30
  39. data/idrac-0.1.7/sig/idrac.rbs +0 -4
  40. data/idrac.py +0 -500
  41. data/lib/idrac/screenshot.rb +0 -49
  42. data/sig/idrac.rbs +0 -4
  43. data/test_firmware_update.rb +0 -68
  44. data/updater.rb +0 -729
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b2c0dae199436d9ce49a07eab55be6f44e9260ece8c64b07f7221384174a72de
4
- data.tar.gz: 5b89e9ef776654053fe6ac4e8d6cd87ad121dfaa37194fd65b3cde2c5d44c683
3
+ metadata.gz: 822357c4c005e77d857696867b06be46e3f1f473a239e2936119aec1e68c5eb9
4
+ data.tar.gz: 6ca9c128259d2d94518b2b22ee0d8bfff02624a8f8b15fbabd816a2e08351f8f
5
5
  SHA512:
6
- metadata.gz: 682eeec6204b0a7f105473fb0c61a44e11e067b48bd8db4c1f693d9895676ae7e8f1dfb6f655d19aeec421fb7fc83c1710508a78ab9f696b2adc6cb6b509bddb
7
- data.tar.gz: bdfd016c0353de003a0182a6c5f582472f9f8071cf6f47a4fd448bccd62ac60c1747634b349a0afcd3422ec2b62842109b662ad500d6bdeee6cfeb55e9d6e47c
6
+ metadata.gz: a50e1c605aaaa5c4cfe72a49a60d41c63765c20e6bfc3d7d43063a0e53cd29804797094e38287e63ee3cddbcd1335ba543417ec75f089541a950ef55654042df
7
+ data.tar.gz: d3306667a4271507a7923a95b78b557ca55abe78900fee320c36bfb98eda0cafbd268afaaa4bf4fee4a2241b344b634ce445900bae9a768132862995553dd813
data/README.md CHANGED
@@ -54,6 +54,11 @@ idrac firmware:update /path/to/firmware.exe --host=192.168.1.100 --username=root
54
54
 
55
55
  # Interactive firmware update
56
56
  idrac firmware:interactive --host=192.168.1.100 --username=root --password=calvin
57
+
58
+ # Display a summary of system information
59
+ idrac summary --host=192.168.1.100 --username=root --password=calvin
60
+ # With verbose output for debugging
61
+ idrac summary --host=192.168.1.100 --username=root --password=calvin --verbose
57
62
  ```
58
63
 
59
64
  All commands automatically handle session expiration by re-authenticating when necessary, ensuring that long-running operations like firmware updates complete successfully even if the iDRAC session times out.
@@ -87,15 +92,10 @@ client = IDRAC.new(
87
92
  # The client automatically handles session expiration (401 errors)
88
93
  # by re-authenticating and retrying the request
89
94
 
90
- # Take a screenshot (using the client convenience method)
95
+ # Take a screenshot (using the client method)
91
96
  filename = client.screenshot
92
97
  puts "Screenshot saved to: #{filename}"
93
98
 
94
- # Or use the Screenshot class directly for more control
95
- screenshot = IDRAC::Screenshot.new(client)
96
- filename = screenshot.capture
97
- puts "Screenshot saved to: #{filename}"
98
-
99
99
  # Firmware operations
100
100
  firmware = IDRAC::Firmware.new(client)
101
101
 
@@ -134,24 +134,51 @@ To install this gem onto your local machine, run `bundle exec rake install`. To
134
134
 
135
135
  ## Changelog
136
136
 
137
+ ### Version 0.1.38
138
+ - **Enhanced License Display**: Updated the summary command to show both license type and description
139
+ - Improved readability by displaying license information in the format "Type (Description)"
140
+ - Better user experience with more detailed license information
141
+
142
+ ### Version 0.1.37
143
+ - **Improved License Detection**: Enhanced license detection using both DMTF standard and Dell OEM methods
144
+ - Added fallback mechanisms to ensure proper license type detection
145
+ - Improved error handling for license information retrieval
146
+
147
+ ### Version 0.1.36
148
+ - **Fixed License Type Display**: Updated the summary command to correctly display Enterprise license
149
+ - **Added Verbose Mode**: New `--verbose` option for the summary command to show detailed API responses
150
+ - Improved debugging capabilities with raw JSON output of system, iDRAC, network, and license information
151
+
152
+ ### Version 0.1.35
153
+ - **Added System Summary Command**: New `summary` command to display key system information
154
+ - Shows power state, model, host name, OS details, service tag, firmware versions, and more
155
+ - Formatted output with color-coding for improved readability
156
+
157
+ ### Version 0.1.34
158
+ - **Fixed Gem Build Process**: Corrected version mismatch in the Rakefile
159
+ - **Improved CLI Structure**: Removed hardcoded command list in favor of explicit host requirements in each command
160
+ - Enhanced code organization and maintainability
161
+
162
+ ### Version 0.1.33
163
+ - **Fixed Command-Line Interface**: Improved handling of commands that don't require a host
164
+ - Made the `firmware:catalog` command work without requiring host, username, and password
165
+ - Enhanced command-line interface reliability
166
+
167
+ ### Version 0.1.32
168
+ - **Fixed Gem Loading Issues**: Ensured proper loading of the colorize gem in the main module
169
+ - Resolved issues with running commands when installed as a gem
170
+ - Improved reliability of command-line interface
171
+
137
172
  ### Version 0.1.31
138
- - **Enhanced Job Monitoring**: Completely redesigned the job monitoring system for firmware updates
139
- - Improved handling of HTTP 202 status codes during job status checks
140
- - Added detailed progress reporting with percentage complete during firmware updates
141
- - Enhanced job ID extraction with multiple fallback mechanisms to ensure proper job tracking
142
- - Improved error handling for common firmware update issues with clear user guidance
143
- - Added better handling of "deployment already in progress" scenarios
144
- - Implemented a more robust firmware download process with better error reporting
145
- - Enhanced the interactive update process with clearer user prompts and status messages
173
+ - **Enhanced Job Monitoring**: Improved firmware update job tracking and monitoring
174
+ - Added more robust error handling during firmware updates
175
+ - Enhanced progress reporting with color-coded status messages
176
+ - Improved recovery mechanisms for common firmware update issues
146
177
 
147
178
  ### Version 0.1.30
148
- - **Enhanced Terminal Output with Colors**: Added colorized output for better readability and user experience
149
- - Integrated the `colorize` gem to provide color-coded messages throughout the application
150
- - Success messages are displayed in green, warnings in yellow, errors in red, and informational messages in cyan
151
- - Improved visual distinction between different types of messages (success, error, warning, info)
152
- - Enhanced readability of firmware update status, system information, and error messages
153
- - Updated all output messages across the codebase for consistent color formatting
154
- - Added color to the test script output for better visualization of the firmware update process
179
+ - **Added Color Output**: Enhanced terminal output with color-coded messages
180
+ - Improved readability of status, warning, and error messages
181
+ - Added the colorize gem as a dependency
155
182
 
156
183
  ### Version 0.1.29
157
184
  - **Enhanced Firmware Update Error Handling**: Improved detection and handling of common firmware update issues
@@ -214,89 +241,4 @@ To install this gem onto your local machine, run `bundle exec rake install`. To
214
241
 
215
242
  ### Version 0.1.21
216
243
  - **Improved Authentication Flow**: Completely restructured the login process
217
- - Renamed `legacy_login` to `webui_login` and limited its use to screenshot functionality only
218
- - Implemented proper Redfish authentication flow: start with direct login to get a session
219
- - Enhanced session management: when max sessions are encountered, delete sessions using direct login
220
- - Simplified code by removing redundant authentication methods and focusing on Redfish standards
221
- - Improved error handling and logging for better troubleshooting
222
-
223
- ### Version 0.1.20
224
- - **Simplified CLI Interface**: Removed the direct-mode CLI option
225
- - Maintained internal direct mode functionality as an automatic fallback mechanism
226
- - The client will still automatically switch to direct mode when session management fails
227
- - This change simplifies the user interface while preserving the robust session handling
228
-
229
- ### Version 0.1.19
230
- - **Basic Auth Session Clearing**: Implemented direct session management using Basic Authentication
231
- - Added ability to list and delete all active sessions without requiring a session
232
- - Improved session clearing by directly accessing the Redfish Sessions API with Basic Auth
233
- - Enhanced force_clear_sessions to first try the direct Basic Auth approach before falling back to login/logout cycles
234
- - Added detailed logging of session clearing operations
235
-
236
- ### Version 0.1.18
237
- - **Direct Mode Implementation**: Added a fallback mechanism for environments with persistent session issues
238
- - Implemented automatic switching to direct mode (Basic Auth) when session creation repeatedly fails
239
- - Added detection of maximum sessions condition to avoid unnecessary session creation attempts
240
- - Improved handling of authentication failures with graceful degradation to direct mode
241
- - Added Basic Auth support for all request types when in direct mode
242
- - Enhanced logging for better visibility into authentication mode changes
243
-
244
- ### Version 0.1.17
245
- - **Enhanced Session Clearing**: Added aggressive session clearing functionality
246
- - Implemented a force_clear_sessions method that attempts multiple login/logout cycles with both authentication methods
247
- - Added automatic session clearing when maximum sessions error is encountered
248
- - Improved retry logic after session clearing
249
- - Added detailed logging during session clearing process for better troubleshooting
250
-
251
- ### Version 0.1.16
252
- - **Implemented Redfish API Session Management**: Completely redesigned session handling to use the proper Redfish API
253
- - Added support for X-Auth-Token authentication (the standard Redfish approach)
254
- - Maintained backward compatibility with legacy session management for screenshot functionality
255
- - Improved session creation and deletion with proper error handling
256
- - Added fallback mechanism to legacy authentication if Redfish session creation fails
257
- - Enhanced logging for better troubleshooting of session-related issues
258
-
259
- ### Version 0.1.15
260
- - **Aggressive Session Management**: Implemented a more robust approach to handle persistent session issues
261
- - Added retry counters with limits to prevent infinite loops
262
- - Increased delays between logout and login operations (5 seconds)
263
- - Added multiple logout attempts to ensure sessions are properly cleared
264
- - Added pre-emptive logout before login to help clear existing sessions
265
- - Improved error messages with attempt counters for better debugging
266
-
267
- ### Version 0.1.14
268
- - **Enhanced Session Management**: Improved handling of "maximum number of user sessions" errors
269
- - Added detection and handling of session limits during initial login
270
- - Added retry mechanism with proper session cleanup
271
- - Added delays between logout and login operations to allow server to process session changes
272
- - Made logout operation more robust by handling potential errors
273
-
274
- ### Version 0.1.13
275
- - **Fixed Maximum Sessions Error**: Added handling for "maximum number of user sessions" errors
276
- - The client now properly logs out before attempting to create a new session
277
- - Improved session management to prevent session buildup on the iDRAC server
278
-
279
- ### Version 0.1.12
280
- - **Improved Session Handling**: Added automatic re-authentication when sessions expire (401 errors)
281
- - The client now automatically re-logs in and retries the request when it encounters a 401 Unauthorized error
282
- - This prevents interruptions during long-running operations when the iDRAC session times out
283
-
284
- ### Version 0.1.11
285
- - Added support for Ruby 3.2.x (previously required Ruby 3.3.0+)
286
- - Fixed SSL verification warnings by making SSL verification optional
287
- - Improved error handling and reporting
288
-
289
- ### Version 0.1.10
290
- - Added base64 gem as a dependency to address Ruby 3.4.0 compatibility warnings
291
- - Updated dependency versions with bounded requirements
292
- - Added proper license specification in gemspec
293
-
294
- ### Version 0.1.9
295
- - Added screenshot functionality with custom output filename support
296
- - Improved firmware update process with better progress reporting
297
- - Enhanced error handling for network connectivity issues
298
- - Added default credentials (root/calvin) to simplify command usage
299
-
300
- ## Contributing
301
-
302
- Bug reports and pull requests are welcome on GitHub at https://github.com/usiegj00/idrac.
244
+ - Renamed `
data/bin/idrac CHANGED
@@ -11,23 +11,24 @@ end
11
11
  require "thor"
12
12
  require "idrac"
13
13
  require "colorize"
14
+ require "json"
14
15
 
15
16
  module IDRAC
16
17
  class CLI < Thor
17
18
  # Make host not required for all commands
18
19
  class_option :host, type: :string, required: false, desc: "iDRAC host address"
19
- class_option :username, type: :string, required: false, default: "root", desc: "iDRAC username (default: root)"
20
- class_option :password, type: :string, required: false, default: "calvin", desc: "iDRAC password (default: calvin)"
20
+ class_option :username, type: :string, required: false, default: "root", desc: "iDRAC username"
21
+ class_option :password, type: :string, required: false, default: "calvin", desc: "iDRAC password"
21
22
  class_option :port, type: :numeric, default: 443, desc: "iDRAC port"
22
23
  class_option :no_ssl, type: :boolean, default: false, desc: "Disable SSL"
23
24
  class_option :verify_ssl, type: :boolean, default: false, desc: "Enable SSL verification (not recommended for iDRAC's self-signed certificates)"
24
- class_option :auto_delete_sessions, type: :boolean, default: true, desc: "Automatically delete sessions when maximum sessions are reached (default: true)"
25
+ class_option :auto_delete_sessions, type: :boolean, default: true, desc: "Automatically delete sessions when maximum sessions are reached"
25
26
 
26
27
  desc "firmware:update PATH", "Update firmware using the specified file"
27
28
  method_option :wait, type: :boolean, default: true, desc: "Wait for the update to complete"
28
29
  method_option :timeout, type: :numeric, default: 3600, desc: "Timeout in seconds when waiting"
29
30
  def firmware_update(path)
30
- # Ensure host is provided for commands that need it
31
+ # This command requires a host
31
32
  ensure_host_provided
32
33
 
33
34
  check_ssl_verification
@@ -48,11 +49,10 @@ module IDRAC
48
49
  desc "firmware:catalog [DIRECTORY]", "Download Dell firmware catalog"
49
50
  def firmware_catalog(directory = nil)
50
51
  # This command doesn't require a host
51
- # Create a FirmwareCatalog instance directly
52
52
  catalog = IDRAC::FirmwareCatalog.new
53
53
 
54
54
  begin
55
- puts "Downloading Dell catalog...".yellow
55
+ puts "Downloading Dell catalog...".light_cyan
56
56
  catalog_path = catalog.download(directory)
57
57
  puts "Catalog downloaded to: #{catalog_path}".green
58
58
  rescue IDRAC::Error => e
@@ -64,7 +64,7 @@ module IDRAC
64
64
  desc "firmware:status", "Show current firmware status and available updates"
65
65
  method_option :catalog, type: :string, desc: "Path to existing catalog file"
66
66
  def firmware_status
67
- # Ensure host is provided for commands that need it
67
+ # This command requires a host
68
68
  ensure_host_provided
69
69
 
70
70
  check_ssl_verification
@@ -113,7 +113,7 @@ module IDRAC
113
113
  desc "firmware:interactive", "Interactive firmware update"
114
114
  method_option :catalog, type: :string, desc: "Path to existing catalog file"
115
115
  def firmware_interactive
116
- # Ensure host is provided for commands that need it
116
+ # This command requires a host
117
117
  ensure_host_provided
118
118
 
119
119
  check_ssl_verification
@@ -178,16 +178,15 @@ module IDRAC
178
178
  desc "screenshot", "Take a screenshot of the current iDRAC console"
179
179
  method_option :output, type: :string, desc: "Output filename (default: idrac_screenshot_timestamp.png)"
180
180
  def screenshot
181
- # Ensure host is provided for commands that need it
181
+ # This command requires a host
182
182
  ensure_host_provided
183
183
 
184
184
  check_ssl_verification
185
185
  client = create_client
186
186
 
187
187
  begin
188
- # Create a Screenshot instance directly
189
- screenshot = IDRAC::Screenshot.new(client)
190
- filename = screenshot.capture
188
+ # Capture a screenshot using the client
189
+ filename = client.screenshot
191
190
 
192
191
  # Rename the file if output option is provided
193
192
  if options[:output]
@@ -205,6 +204,123 @@ module IDRAC
205
204
  end
206
205
  end
207
206
 
207
+ desc "summary", "Display a summary of system information"
208
+ method_option :verbose, type: :boolean, default: false, desc: "Show verbose output including raw API responses"
209
+ def summary
210
+ # This command requires a host
211
+ ensure_host_provided
212
+
213
+ check_ssl_verification
214
+ client = create_client
215
+
216
+ begin
217
+ # Get system information using authenticated_request
218
+ puts "Retrieving system information...".light_yellow if options[:verbose]
219
+ system_response = client.authenticated_request(:get, "/redfish/v1/Systems/System.Embedded.1")
220
+ system_info = JSON.parse(system_response.body)
221
+ puts JSON.pretty_generate(system_info).light_yellow if options[:verbose]
222
+
223
+ # Get iDRAC information using authenticated_request
224
+ puts "Retrieving iDRAC information...".light_yellow if options[:verbose]
225
+ idrac_response = client.authenticated_request(:get, "/redfish/v1/Managers/iDRAC.Embedded.1")
226
+ idrac_info = JSON.parse(idrac_response.body)
227
+ puts JSON.pretty_generate(idrac_info).light_yellow if options[:verbose]
228
+
229
+ # Get network information using authenticated_request
230
+ puts "Retrieving network information...".light_yellow if options[:verbose]
231
+ network_response = client.authenticated_request(:get, "/redfish/v1/Managers/iDRAC.Embedded.1/EthernetInterfaces/NIC.1")
232
+ network_info = JSON.parse(network_response.body)
233
+ puts JSON.pretty_generate(network_info).light_yellow if options[:verbose]
234
+
235
+ # Initialize license_type to Unknown
236
+ license_type = "Unknown"
237
+ license_description = nil
238
+
239
+ # Try to get license information using DMTF standard method
240
+ begin
241
+ puts "Retrieving license information (DMTF method)...".light_yellow if options[:verbose]
242
+ license_response = client.authenticated_request(:get, "/redfish/v1/LicenseService/Licenses")
243
+ license_info = JSON.parse(license_response.body)
244
+ puts JSON.pretty_generate(license_info).light_yellow if options[:verbose]
245
+
246
+ # Extract license type if licenses are found
247
+ if license_info["Members"] && !license_info["Members"].empty?
248
+ license_entry_response = client.authenticated_request(:get, license_info["Members"][0]["@odata.id"])
249
+ license_entry = JSON.parse(license_entry_response.body)
250
+ puts JSON.pretty_generate(license_entry).light_yellow if options[:verbose]
251
+
252
+ # Get license type from EntitlementId or LicenseType
253
+ if license_entry["EntitlementId"] && license_entry["EntitlementId"].include?("Enterprise")
254
+ license_type = "Enterprise"
255
+ elsif license_entry["LicenseType"]
256
+ license_type = license_entry["LicenseType"]
257
+ end
258
+
259
+ # Get license description if available
260
+ license_description = license_entry["Description"] if license_entry["Description"]
261
+ end
262
+ rescue => e
263
+ puts "Error retrieving license information using DMTF method: #{e.message}".light_red if options[:verbose]
264
+
265
+ # If DMTF method fails, try Dell OEM method
266
+ begin
267
+ puts "Retrieving license information (Dell OEM method)...".light_yellow if options[:verbose]
268
+ dell_license_response = client.authenticated_request(:get, "/redfish/v1/Managers/iDRAC.Embedded.1/Oem/Dell/DellLicenses")
269
+ dell_license_info = JSON.parse(dell_license_response.body)
270
+ puts JSON.pretty_generate(dell_license_info).light_yellow if options[:verbose]
271
+
272
+ # Extract license type if licenses are found
273
+ if dell_license_info["Members"] && !dell_license_info["Members"].empty?
274
+ dell_license_entry_response = client.authenticated_request(:get, dell_license_info["Members"][0]["@odata.id"])
275
+ dell_license_entry = JSON.parse(dell_license_entry_response.body)
276
+ puts JSON.pretty_generate(dell_license_entry).light_yellow if options[:verbose]
277
+
278
+ # Get license type from LicenseType or Description
279
+ if dell_license_entry["LicenseType"]
280
+ license_type = dell_license_entry["LicenseType"]
281
+ elsif dell_license_entry["Description"] && dell_license_entry["Description"].include?("Enterprise")
282
+ license_type = "Enterprise"
283
+ end
284
+
285
+ # Get license description if available
286
+ license_description = dell_license_entry["Description"] if dell_license_entry["Description"]
287
+ end
288
+ rescue => e2
289
+ puts "Error retrieving Dell license information: #{e2.message}".light_red if options[:verbose]
290
+ end
291
+ end
292
+
293
+ # Format the license display string
294
+ license_display = license_type
295
+ if license_description
296
+ license_display = "#{license_type} (#{license_description})"
297
+ end
298
+
299
+ # Format and display the information
300
+ puts "System Summary:".green.bold
301
+ puts "=" * 50
302
+
303
+ puts "Power State:".ljust(25) + (system_info["PowerState"] || "Unknown").light_cyan
304
+ puts "Model:".ljust(25) + (system_info["Model"] || "Unknown").light_cyan
305
+ puts "Host Name:".ljust(25) + (system_info["HostName"] || "Unknown").light_cyan
306
+ puts "Operating System:".ljust(25) + (system_info.dig("Oem", "Dell", "OperatingSystem") || "Unknown").light_cyan
307
+ puts "Operating System Version:".ljust(25) + (system_info.dig("Oem", "Dell", "OperatingSystemVersion") || "Unknown").light_cyan
308
+ puts "Service Tag:".ljust(25) + (system_info["SKU"] || "Unknown").light_cyan
309
+ puts "BIOS Version:".ljust(25) + (system_info.dig("BiosVersion") || "Unknown").light_cyan
310
+ puts "iDRAC Firmware Version:".ljust(25) + (idrac_info.dig("FirmwareVersion") || "Unknown").light_cyan
311
+ puts "IP Address:".ljust(25) + (network_info.dig("IPv4Addresses", 0, "Address") || "Unknown").light_cyan
312
+ puts "iDRAC MAC Address:".ljust(25) + (network_info.dig("MACAddress") || "Unknown").light_cyan
313
+ puts "License:".ljust(25) + license_display.light_cyan
314
+
315
+ puts "=" * 50
316
+ rescue IDRAC::Error => e
317
+ puts "Error: #{e.message}".red.bold
318
+ exit 1
319
+ ensure
320
+ client.logout
321
+ end
322
+ end
323
+
208
324
  map "firmware:update" => :firmware_update
209
325
  map "firmware:catalog" => :firmware_catalog
210
326
  map "firmware:status" => :firmware_status
@@ -213,7 +329,7 @@ module IDRAC
213
329
  private
214
330
 
215
331
  def ensure_host_provided
216
- unless options[:host]
332
+ if !options[:host]
217
333
  puts "Error: No value provided for required option '--host'".red.bold
218
334
  exit 1
219
335
  end
@@ -235,8 +351,7 @@ module IDRAC
235
351
  password: options[:password],
236
352
  port: options[:port],
237
353
  use_ssl: !options[:no_ssl],
238
- verify_ssl: options[:verify_ssl],
239
- auto_delete_sessions: options[:auto_delete_sessions]
354
+ verify_ssl: options[:verify_ssl]
240
355
  )
241
356
  end
242
357
  end
data/idrac.gemspec CHANGED
@@ -21,13 +21,14 @@ Gem::Specification.new do |spec|
21
21
  # spec.metadata["changelog_uri"] = "TODO: Put your gem's CHANGELOG.md URL here."
22
22
 
23
23
  # Specify which files should be added to the gem when it is released.
24
- # The `git ls-files -z` loads the files in the RubyGem that have been added into git.
25
- spec.files = Dir.chdir(__dir__) do
26
- `git ls-files -z`.split("\x0").reject do |f|
27
- (File.expand_path(f) == __FILE__) ||
28
- f.start_with?(*%w[test/ spec/ features/ .git .circleci appveyor Gemfile])
29
- end
30
- end
24
+ # Instead of using git ls-files, use a more explicit approach
25
+ spec.files = Dir[
26
+ "lib/**/*",
27
+ "bin/*",
28
+ "README.md",
29
+ "LICENSE.txt",
30
+ "*.gemspec"
31
+ ]
31
32
  spec.bindir = "bin"
32
33
  spec.executables = ["idrac"]
33
34
  spec.require_paths = ["lib"]
@@ -39,7 +40,7 @@ Gem::Specification.new do |spec|
39
40
  spec.add_dependency "faraday-multipart", ">= 1.0.0", "< 1.1.0"
40
41
  spec.add_dependency "thor", ">= 1.2.0", "< 1.4.0"
41
42
  spec.add_dependency "base64", "~> 0.1", ">= 0.1.0"
42
- spec.add_dependency "colorize", "~> 0.8"
43
+ spec.add_dependency "colorize", "~> 1.1"
43
44
 
44
45
  # Development dependencies
45
46
  spec.add_development_dependency "bundler", "~> 2.4", ">= 2.4.0"