rubyipmi 0.11.1 → 0.12.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: ded5dae3237a5610e1b3d5e1595743be1401636b68b76965d9b1c4bfaa174ac8
4
- data.tar.gz: bbfd85a434bfafdeccd6efbcea2dc898032b04b92ceb6c7ebe918f11ac12e4eb
3
+ metadata.gz: 6f4f084aa7f49cb5e387e91beb0d0e3127de0c03bf320f49c0ebbb3134c0e37c
4
+ data.tar.gz: 23e6a5dd885284aa9c2806b6ae7196f8d03fbf7009a72b9b89a66cd9a7e9e0b8
5
5
  SHA512:
6
- metadata.gz: 60e95d651aa6b3275f91ea531628c33a473eaaf3d3e34c7c60a61d97cbbcbedfa907356138010eae1d0eda3c0a362316f8fb34e472b594edc834bbd78b0bb619
7
- data.tar.gz: 1d8bb664adf6c327a238358ace1a90fdff409cbf8b8328d15f7081f1e60f114f55efdfbe754f98f08ce92ea59079ebd970f07834b6c38b14c3300b622e99e84c
6
+ metadata.gz: 7d7b1f5a620e693dbbc013d80311c45496e9fa49494ed90b936b7e17bc9084123b5951878962ab53738ef484b4bda2d737afa13b9461d7fdf634913022acaabd
7
+ data.tar.gz: 809ac56808cc4183461e6722224220a64be4904940aa7eef59a94abccdcf4a750ecb031c83ec706b4206f0ecc8e60272e1fd3f8d637bca7ec93b5c1100111a4c
data/CHANGELOG.md ADDED
@@ -0,0 +1,236 @@
1
+ # Changelog
2
+
3
+ All notable changes to this project will be documented in this file.
4
+
5
+ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
+ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
+
8
+ ## [Unreleased] - 0.12.1
9
+
10
+ ### Fixed
11
+ - Don't re-raise the original exception in basecommand
12
+ - Properly mock capture3 API which returns a Process::Status, not true
13
+ - Don't fail when status was success
14
+ - Strip `which` output like it was before the Ruby 3.0 changes
15
+
16
+ ### Changed
17
+ - Update link to sensu ipmi plugin
18
+
19
+ ## [0.12.0] - 2024
20
+
21
+ ### Added
22
+ - Ruby 3.4 support
23
+ - GitHub Actions for CI/CD testing
24
+ - Logger gem dependency (will be removed in Ruby 3.5)
25
+
26
+ ### Changed
27
+ - Test on Ruby 3.1, 3.2 & 3.3
28
+ - Fix tests for Ruby 3.0
29
+ - Update actions/checkout to v4
30
+ - Remove highline as a runtime dependency
31
+ - Simplify gemspec and Gemfile
32
+ - Use SPDX license code in gemspec
33
+ - Limit dependency ranges to avoid gemspec warnings
34
+ - Let git ignore *.gem files
35
+
36
+ ## [0.11.1] - 2023
37
+
38
+ ### Fixed
39
+ - Exclude hidden files from the gem package
40
+
41
+ ## [0.11.0] - 2023
42
+
43
+ ### Added
44
+ - SensorsMixin to remove duplicate code
45
+ - Rubocop GuardClause support
46
+ - Additional rubocop cops
47
+
48
+ ### Changed
49
+ - Remove jeweler dependency, replace with bundler commands
50
+ - Use HTTPS for homepage field in gemspec
51
+ - Leverage Enumerable#each_with_object
52
+ - Move #drivers_map to a constant
53
+ - Update .rubocop.yml
54
+ - Reword confusing project description
55
+ - Update README.md section on booting to specific devices
56
+ - Remove puppet code and vagrant
57
+
58
+ ### Fixed
59
+ - Fix infinite loop when executing 'lan print' command
60
+ - Fix "NoMethodError: undefined method `success?' for nil:NilClass"
61
+ - Fix rubocop Style/MethodName "Use snake_case for method names"
62
+ - Remove duplicate methods
63
+ - Remove if/else logic and unnecessary return in #validate_status
64
+ - Remove pry statement from method
65
+ - Fix many rubocop style infractions
66
+
67
+ ## [0.10.0] - 2022
68
+
69
+ ### Changed
70
+ - Make the driver default to lan20 (users of older IPMI devices will need to pass the specified driver type)
71
+
72
+ ## [0.9.3] - 2022
73
+
74
+ ### Fixed
75
+ - Normalize the options being passed into the connect method
76
+
77
+ ## [0.9.2] - 2022
78
+
79
+ ### Fixed
80
+ - Fix issue where is_provider_installed? should only return a boolean value instead of raising an error
81
+ - Fix minor style issue where providers_installed? was returning an array when a boolean might have been expected
82
+
83
+ ### Changed
84
+ - Updated README about support and added TOC
85
+
86
+ ## [0.9.1] - 2022
87
+
88
+ ### Fixed
89
+ - Fix issue with connection_works? API call when command raises an error
90
+
91
+ ### Changed
92
+ - Updated README and release notes
93
+ - Fix spelling mistakes
94
+
95
+ ## [0.9.0] - 2022
96
+
97
+ ### Added
98
+ - Ability to generate a logfile
99
+ - Ability to test connection
100
+ - Coveralls support for coverage data
101
+
102
+ ### Changed
103
+ - Move to rspec3 expect syntax
104
+ - Refactor get_diag function to be useful
105
+ - Remove 1.9.2 support and add 2.2 support
106
+ - Updated .gitignore to stop watching Gemfile.lock
107
+ - Updated spec tests to load spec_helper differently
108
+ - Removed development support for Ruby 1.8
109
+
110
+ ### Fixed
111
+ - Fix issue with freeipmi lan info and auto fix
112
+ - Fix issue with options not being deleted for fru
113
+
114
+ ## [0.8.1] - 2021
115
+
116
+ ### Changed
117
+ - Switch to LGPL license
118
+ - Remove rcov in favor of simplecov
119
+ - Updated gemspec and removed rcov from Gemfile
120
+ - Added new rubies to travis testing suite
121
+
122
+ ## [0.8.0] - 2021
123
+
124
+ ### Added
125
+ - Option to specify privilege level
126
+ - Support for multiple driver-types
127
+ - Flexible options hash
128
+
129
+ ### Changed
130
+ - Changed License from GPL to LGPL
131
+ - Refactored new opts hash feature
132
+ - Added unit tests for opts hash feature
133
+ - Updated README
134
+
135
+ ### Fixed
136
+ - Fix ipmitool power.on precheck
137
+
138
+ ## [0.7.0] - 2020
139
+
140
+ ### Added
141
+ - Debug option (set rubyipmi_debug=true environment variable)
142
+ - Attribute reader for result to retrieve from outside classes
143
+ - Travis CI support
144
+
145
+ ### Changed
146
+ - Updated gemspec files
147
+ - Updated README
148
+ - Removed development support for Ruby 2.0.0
149
+
150
+ ### Fixed
151
+ - Fix bug where command was returning the value and not the result
152
+ - Fix bug where bmc-config was not raising an error when errors occurred
153
+ - Fix issues with freeipmi not getting right error code
154
+ - Updated unit tests for error code checking
155
+ - Updated ipmitool spec tests and fixed error code search functionality
156
+
157
+ ## [0.6.0] - 2020
158
+
159
+ ### Added
160
+ - Support for using bmc reset
161
+
162
+ ### Changed
163
+ - Default connection for ipmitool now uses IPMI 2.0
164
+ - Updated license
165
+
166
+ ## [0.5.1] - 2020
167
+
168
+ ### Fixed
169
+ - Fix loading error in rbenv environment
170
+
171
+ ### Changed
172
+ - Updated README
173
+
174
+ ## [0.5.0] - 2020
175
+
176
+ ### Added
177
+ - FRU (Field Replaceable Unit) support
178
+ - Hidden password security
179
+ - Printdiag function
180
+
181
+ ## [0.4.0] - 2020
182
+
183
+ ### Added
184
+ - Sensor support
185
+
186
+ ### Changed
187
+ - Renamed subnet function to netmask function
188
+
189
+ ## [0.3.3] - 2020
190
+
191
+ ### Changed
192
+ - Updated error output
193
+
194
+ ## [0.3.2] - 2020
195
+
196
+ ### Fixed
197
+ - Fix issue with commands not returning value
198
+
199
+ ## [0.3.1] - 2020
200
+
201
+ ### Fixed
202
+ - Fix issue with ipmitool identify
203
+
204
+ ## [0.3.0] - 2020
205
+
206
+ ### Added
207
+ - Makecommand function
208
+ - BMC lan info
209
+ - Boot settings
210
+
211
+ ### Changed
212
+ - Updated tests and lan parser
213
+
214
+ ### Fixed
215
+ - Fix error with getting info object
216
+
217
+ ## [0.2.0] - 2020
218
+
219
+ ### Added
220
+ - BMC info function
221
+
222
+ ### Changed
223
+ - Updated tests
224
+
225
+ ## [0.1.1] - 2020
226
+
227
+ ### Fixed
228
+ - Fix issue with power cycle when system is off
229
+
230
+ ### Changed
231
+ - Updated tests
232
+
233
+ ## [0.1.0] - 2020
234
+
235
+ ### Added
236
+ - Initial release with ruby-freeipmi and ipmitool code support
data/CONTRIBUTORS.md ADDED
@@ -0,0 +1,8 @@
1
+ ## Contributors
2
+ Big thank you to our maintainers and contributors.
3
+
4
+ - Ewoud Kohl van Wijngaarden @ekohl
5
+ - Lukáš Zapletal @lzap
6
+ - Evgeni Golov @evgeni
7
+ - Mateusz Gozdek
8
+ - Brandon Dunne @bdunne
data/Gemfile CHANGED
@@ -1,13 +1,11 @@
1
1
  source "http://rubygems.org"
2
2
 
3
+ gemspec
4
+
3
5
  group :development do
4
- gem "rspec", "~> 3.1"
5
- gem "rdoc", "~> 3.12"
6
- gem "bundler", ">= 2.0.0"
7
- gem "highline"
8
- gem "rake"
9
- gem 'coveralls', :require => false
6
+ gem 'coveralls_reborn', require: false
10
7
  gem 'pry'
11
8
  gem 'pry-rescue'
12
- gem "rubocop", "~> 0.33.0", :require => false
9
+ gem "rubocop", :require => false
10
+ gem "reline"
13
11
  end
data/README.md CHANGED
@@ -43,7 +43,7 @@ Rubyipmi was built because I wanted an object oriented way to get data from BMC
43
43
  and if any IPMI hacks/workarounds were required I wanted to build those into the library to make life easier.
44
44
 
45
45
  ## Projects that use Rubyipmi
46
- * https://github.com/sensu/sensu-community-plugins/blob/master/plugins/ipmi/check-sensor.rb
46
+ * https://github.com/sensu-plugins/sensu-plugins-ipmi
47
47
  * https://github.com/theforeman/smart-proxy (Turns Rubyipmi into a Remote Web API Proxy server)
48
48
  * https://github.com/logicminds/ipmispec (just started)
49
49
 
data/RELEASE_NOTES.md CHANGED
@@ -1,3 +1,14 @@
1
+ ## unreleased
2
+
3
+ ### 0.12.0
4
+ * Add Ruby 3.4 support @ekohl
5
+ * Update test matrix for other 3.x rubies @ekohl
6
+ * Remove highline as a runtime dependency + simpify gemspec & Gemfile @ekohl
7
+ * Use the SPDX license code in gemspec @ekohl
8
+ * Limit dependency ranges to avoid gemspec warnings @ekohl
9
+ * Simplify gemspec @ekohl
10
+ * Adds github actions for testing
11
+
1
12
  ### 0.11.1
2
13
  * remove hidden files from gem package
3
14
 
@@ -13,7 +24,7 @@ This is a big update with many minor changes and bug fixes. Thank you for all t
13
24
  Adds a missing counter incrementation with the same style as
14
25
  in basecommands and make it return current @info in case of a failure,
15
26
  so all methods accessing it will just get return nil.
16
-
27
+
17
28
  - Leverage Enumerable#each_with_object
18
29
  - Add a SensorsMixin to remove duplicate code
19
30
  - Enable Rubocop GuardClause and fix complaints
@@ -32,7 +43,7 @@ This is a big update with many minor changes and bug fixes. Thank you for all t
32
43
  - Remove if / else logic and unnecessary return in #validate_status
33
44
  - Reword confusing project description
34
45
  - Update README.md section on booting to specific devices
35
- - Update documentation around bootpxe, bootdisk functions
46
+ - Update documentation around bootpxe, bootdisk functions
36
47
  - Remove pry statement from method
37
48
  ### 0.10.0
38
49
  * gh-26 - make the driver default to lan20
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.10.0
1
+ 0.12.1
@@ -37,9 +37,8 @@ module Rubyipmi
37
37
  end
38
38
 
39
39
  def locate_command(commandname)
40
- location = `which #{commandname}`.strip
41
- unless $?.success?
42
- logger.error("#{commandname} command not found, is #{commandname} installed?") if logger
40
+ unless location = Rubyipmi.locate_command(commandname)
41
+ logger&.error("#{commandname} command not found, is #{commandname} installed?")
43
42
  raise "#{commandname} command not found, is #{commandname} installed?"
44
43
  end
45
44
  location
@@ -67,10 +66,10 @@ module Rubyipmi
67
66
  logger.debug(makecommand) if logger
68
67
  begin
69
68
  command = makecommand
70
- @lastcall = "#{command}"
71
- @result = `#{command} 2>&1`
69
+ @lastcall = command.to_s
70
+ @result, @result_err, status = Rubyipmi.capture3(command)
72
71
  # sometimes the command tool does not return the correct result, validate it with additional code
73
- process_status = validate_status($?)
72
+ process_status = validate_status(status)
74
73
  rescue
75
74
  if retrycount < max_retry_count
76
75
  find_fix(@result)
@@ -108,7 +107,7 @@ module Rubyipmi
108
107
 
109
108
  # This method will check if the results are really valid as the exit code can be misleading and incorrect
110
109
  def validate_status(exitstatus)
111
- raise "Error occurred" unless exitstatus.success?
110
+ raise "Error occurred" unless exitstatus.respond_to?(:success?) && exitstatus.success?
112
111
 
113
112
  true
114
113
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Rubyipmi
4
- VERSION = '0.11.1'.freeze
4
+ VERSION = '0.12.1'.freeze
5
5
  end
data/lib/rubyipmi.rb CHANGED
@@ -19,6 +19,7 @@
19
19
  require 'rubyipmi/ipmitool/connection'
20
20
  require 'rubyipmi/freeipmi/connection'
21
21
  require 'logger'
22
+ require 'open3'
22
23
 
23
24
  class NullLogger < Logger
24
25
  def initialize(*_args)
@@ -144,11 +145,18 @@ module Rubyipmi
144
145
  PRIV_TYPES.include?(type)
145
146
  end
146
147
 
148
+ # test-friendly capture3
149
+ def self.capture3(cmd)
150
+ return Open3.capture3(cmd)
151
+ end
152
+
147
153
  # method used to find the command which also makes it easier to mock with
148
154
  def self.locate_command(commandname)
149
- location = `which #{commandname}`.strip
150
- location = nil unless $?.success?
151
- location
155
+ stdout, stderr, status = Open3.capture3("which #{commandname}")
156
+ logger&.error("Which command returned: #{stderr}") unless status.success?
157
+
158
+ return nil unless status.success?
159
+ stdout.strip
152
160
  end
153
161
 
154
162
  # Return true or false if the provider is available
data/rubyipmi.gemspec CHANGED
@@ -6,8 +6,6 @@ Gem::Specification.new do |s|
6
6
  s.name = "rubyipmi"
7
7
  s.version = Rubyipmi::VERSION
8
8
 
9
- s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
10
- s.require_paths = ["lib"]
11
9
  s.authors = ["Corey Osman"]
12
10
  s.date = "2021-09-29"
13
11
  s.description = "Controls IPMI devices via command line wrapper for ipmitool and freeipmi"
@@ -20,15 +18,14 @@ Gem::Specification.new do |s|
20
18
  f.match(/^(\.|test|spec|features)/) || f.match(/^*.tar\.gz/)
21
19
  end
22
20
  s.homepage = "https://github.com/logicminds/rubyipmi"
23
- s.licenses = ["LGPLv2.1"]
24
- s.rubygems_version = "2.4.5"
21
+ s.license = "LGPL-2.1-only"
25
22
  s.summary = "A ruby wrapper for ipmi command line tools that supports ipmitool and freeipmi"
26
23
  s.require_paths = ['lib']
27
- s.add_development_dependency(%q<rspec>, ["~> 3.1"])
28
- s.add_development_dependency(%q<rdoc>, ["~> 3.12"])
29
- s.add_development_dependency(%q<bundler>, [">= 1.1.5"])
30
- s.add_development_dependency(%q<highline>, [">= 0"])
31
- s.add_development_dependency(%q<rake>, [">= 0"])
32
- s.add_dependency(%q<highline>, [">= 0"])
24
+ s.add_dependency 'observer', '~> 0.1.0'
25
+ s.add_dependency 'logger'
26
+ s.add_development_dependency 'rspec'
27
+ s.add_development_dependency 'rdoc', "~> 6.1"
28
+ s.add_development_dependency 'bundler', "~> 2.0"
29
+ s.add_development_dependency 'highline', '>= 1.0', '< 3'
30
+ s.add_development_dependency 'rake', '~> 13'
33
31
  end
34
-
metadata CHANGED
@@ -1,99 +1,118 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rubyipmi
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.11.1
4
+ version: 0.12.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Corey Osman
8
- autorequire:
9
8
  bindir: bin
10
9
  cert_chain: []
11
10
  date: 2021-09-29 00:00:00.000000000 Z
12
11
  dependencies:
13
12
  - !ruby/object:Gem::Dependency
14
- name: rspec
13
+ name: observer
15
14
  requirement: !ruby/object:Gem::Requirement
16
15
  requirements:
17
16
  - - "~>"
18
17
  - !ruby/object:Gem::Version
19
- version: '3.1'
20
- type: :development
18
+ version: 0.1.0
19
+ type: :runtime
21
20
  prerelease: false
22
21
  version_requirements: !ruby/object:Gem::Requirement
23
22
  requirements:
24
23
  - - "~>"
25
24
  - !ruby/object:Gem::Version
26
- version: '3.1'
25
+ version: 0.1.0
27
26
  - !ruby/object:Gem::Dependency
28
- name: rdoc
27
+ name: logger
29
28
  requirement: !ruby/object:Gem::Requirement
30
29
  requirements:
31
- - - "~>"
30
+ - - ">="
32
31
  - !ruby/object:Gem::Version
33
- version: '3.12'
34
- type: :development
32
+ version: '0'
33
+ type: :runtime
35
34
  prerelease: false
36
35
  version_requirements: !ruby/object:Gem::Requirement
37
36
  requirements:
38
- - - "~>"
37
+ - - ">="
39
38
  - !ruby/object:Gem::Version
40
- version: '3.12'
39
+ version: '0'
41
40
  - !ruby/object:Gem::Dependency
42
- name: bundler
41
+ name: rspec
43
42
  requirement: !ruby/object:Gem::Requirement
44
43
  requirements:
45
44
  - - ">="
46
45
  - !ruby/object:Gem::Version
47
- version: 1.1.5
46
+ version: '0'
48
47
  type: :development
49
48
  prerelease: false
50
49
  version_requirements: !ruby/object:Gem::Requirement
51
50
  requirements:
52
51
  - - ">="
53
52
  - !ruby/object:Gem::Version
54
- version: 1.1.5
53
+ version: '0'
55
54
  - !ruby/object:Gem::Dependency
56
- name: highline
55
+ name: rdoc
57
56
  requirement: !ruby/object:Gem::Requirement
58
57
  requirements:
59
- - - ">="
58
+ - - "~>"
60
59
  - !ruby/object:Gem::Version
61
- version: '0'
60
+ version: '6.1'
62
61
  type: :development
63
62
  prerelease: false
64
63
  version_requirements: !ruby/object:Gem::Requirement
65
64
  requirements:
66
- - - ">="
65
+ - - "~>"
67
66
  - !ruby/object:Gem::Version
68
- version: '0'
67
+ version: '6.1'
69
68
  - !ruby/object:Gem::Dependency
70
- name: rake
69
+ name: bundler
71
70
  requirement: !ruby/object:Gem::Requirement
72
71
  requirements:
73
- - - ">="
72
+ - - "~>"
74
73
  - !ruby/object:Gem::Version
75
- version: '0'
74
+ version: '2.0'
76
75
  type: :development
77
76
  prerelease: false
78
77
  version_requirements: !ruby/object:Gem::Requirement
79
78
  requirements:
80
- - - ">="
79
+ - - "~>"
81
80
  - !ruby/object:Gem::Version
82
- version: '0'
81
+ version: '2.0'
83
82
  - !ruby/object:Gem::Dependency
84
83
  name: highline
85
84
  requirement: !ruby/object:Gem::Requirement
86
85
  requirements:
87
86
  - - ">="
88
87
  - !ruby/object:Gem::Version
89
- version: '0'
90
- type: :runtime
88
+ version: '1.0'
89
+ - - "<"
90
+ - !ruby/object:Gem::Version
91
+ version: '3'
92
+ type: :development
91
93
  prerelease: false
92
94
  version_requirements: !ruby/object:Gem::Requirement
93
95
  requirements:
94
96
  - - ">="
95
97
  - !ruby/object:Gem::Version
96
- version: '0'
98
+ version: '1.0'
99
+ - - "<"
100
+ - !ruby/object:Gem::Version
101
+ version: '3'
102
+ - !ruby/object:Gem::Dependency
103
+ name: rake
104
+ requirement: !ruby/object:Gem::Requirement
105
+ requirements:
106
+ - - "~>"
107
+ - !ruby/object:Gem::Version
108
+ version: '13'
109
+ type: :development
110
+ prerelease: false
111
+ version_requirements: !ruby/object:Gem::Requirement
112
+ requirements:
113
+ - - "~>"
114
+ - !ruby/object:Gem::Version
115
+ version: '13'
97
116
  description: Controls IPMI devices via command line wrapper for ipmitool and freeipmi
98
117
  email: corey@logicminds.biz
99
118
  executables: []
@@ -102,6 +121,8 @@ extra_rdoc_files:
102
121
  - LICENSE.txt
103
122
  - README.md
104
123
  files:
124
+ - CHANGELOG.md
125
+ - CONTRIBUTORS.md
105
126
  - Gemfile
106
127
  - LICENSE.txt
107
128
  - README.md
@@ -140,9 +161,8 @@ files:
140
161
  - rubyipmi.gemspec
141
162
  homepage: https://github.com/logicminds/rubyipmi
142
163
  licenses:
143
- - LGPLv2.1
164
+ - LGPL-2.1-only
144
165
  metadata: {}
145
- post_install_message:
146
166
  rdoc_options: []
147
167
  require_paths:
148
168
  - lib
@@ -157,8 +177,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
157
177
  - !ruby/object:Gem::Version
158
178
  version: '0'
159
179
  requirements: []
160
- rubygems_version: 3.0.3
161
- signing_key:
180
+ rubygems_version: 3.6.2
162
181
  specification_version: 4
163
182
  summary: A ruby wrapper for ipmi command line tools that supports ipmitool and freeipmi
164
183
  test_files: []