rubyipmi 0.11.0 → 0.12.0
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/CONTRIBUTORS.md +8 -0
- data/Gemfile +5 -7
- data/RELEASE_NOTES.md +16 -2
- data/VERSION +1 -1
- data/lib/rubyipmi/commands/basecommand.rb +9 -8
- data/lib/rubyipmi/version.rb +1 -1
- data/lib/rubyipmi.rb +11 -3
- data/rubyipmi.gemspec +9 -12
- metadata +50 -37
- data/.document +0 -5
- data/.gitignore +0 -50
- data/.rspec +0 -1
- data/.rubocop.yml +0 -66
- data/.travis.yml +0 -13
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b400cae906782f5f4d2c2812a67e08db4d01ee28c29d098764eb06172aaece4c
|
4
|
+
data.tar.gz: eaf5ef307e3b93d26ca97e38776b5e97781602524fff7a9fa726bea86feb1454
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 45e700715cfff358dc1409c3521e8a731615a20d31b1f3452b911188fe0e8d85a707367b840ba4a699bab431242edace43ce1ae11018d1cc24394e11e4f61f90
|
7
|
+
data.tar.gz: 47c8628e9e278a755afc369e04a71914eab88607e3945400bdcb940b8a652cac627c1bcb2e7a0ac6677f5e3ed732e8b7ad08e3e3a2ae2d8f2ec0bb54578513e4
|
data/CONTRIBUTORS.md
ADDED
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
|
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",
|
9
|
+
gem "rubocop", :require => false
|
10
|
+
gem "reline"
|
13
11
|
end
|
data/RELEASE_NOTES.md
CHANGED
@@ -1,3 +1,17 @@
|
|
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
|
+
|
12
|
+
### 0.11.1
|
13
|
+
* remove hidden files from gem package
|
14
|
+
|
1
15
|
### 0.11.0
|
2
16
|
This is a big update with many minor changes and bug fixes. Thank you for all that submitted fixes.
|
3
17
|
- Removes jeweler dependency and replaces with bundler commands, updates gemspec
|
@@ -10,7 +24,7 @@ This is a big update with many minor changes and bug fixes. Thank you for all t
|
|
10
24
|
Adds a missing counter incrementation with the same style as
|
11
25
|
in basecommands and make it return current @info in case of a failure,
|
12
26
|
so all methods accessing it will just get return nil.
|
13
|
-
|
27
|
+
|
14
28
|
- Leverage Enumerable#each_with_object
|
15
29
|
- Add a SensorsMixin to remove duplicate code
|
16
30
|
- Enable Rubocop GuardClause and fix complaints
|
@@ -29,7 +43,7 @@ This is a big update with many minor changes and bug fixes. Thank you for all t
|
|
29
43
|
- Remove if / else logic and unnecessary return in #validate_status
|
30
44
|
- Reword confusing project description
|
31
45
|
- Update README.md section on booting to specific devices
|
32
|
-
- Update documentation around bootpxe, bootdisk functions
|
46
|
+
- Update documentation around bootpxe, bootdisk functions
|
33
47
|
- Remove pry statement from method
|
34
48
|
### 0.10.0
|
35
49
|
* gh-26 - make the driver default to lan20
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.
|
1
|
+
0.12.0
|
@@ -37,9 +37,8 @@ module Rubyipmi
|
|
37
37
|
end
|
38
38
|
|
39
39
|
def locate_command(commandname)
|
40
|
-
location =
|
41
|
-
|
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 =
|
71
|
-
@result =
|
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)
|
@@ -96,7 +95,8 @@ module Rubyipmi
|
|
96
95
|
begin
|
97
96
|
fix = ErrorCodes.search(result)
|
98
97
|
@options.merge_notify!(fix)
|
99
|
-
rescue
|
98
|
+
rescue e
|
99
|
+
raise e
|
100
100
|
Rubyipmi.logger.debug("Could not find fix for error code: \n#{result}") if logger
|
101
101
|
raise "Could not find fix for error code: \n#{result}"
|
102
102
|
end
|
@@ -108,7 +108,8 @@ module Rubyipmi
|
|
108
108
|
|
109
109
|
# This method will check if the results are really valid as the exit code can be misleading and incorrect
|
110
110
|
def validate_status(exitstatus)
|
111
|
-
raise "Error occurred" unless exitstatus
|
111
|
+
raise "Error occurred" unless exitstatus
|
112
|
+
raise "Error occurred" if exitstatus.is_a?(Process::Status) && exitstatus.success?
|
112
113
|
|
113
114
|
true
|
114
115
|
end
|
data/lib/rubyipmi/version.rb
CHANGED
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
|
-
|
150
|
-
|
151
|
-
|
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
|
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"
|
@@ -17,18 +15,17 @@ Gem::Specification.new do |s|
|
|
17
15
|
"README.md"
|
18
16
|
]
|
19
17
|
s.files = `git ls-files -z`.split("\x0").reject do |f|
|
20
|
-
f.match(/^(test|spec|features)/) || f.match(/^*.tar\.gz/)
|
18
|
+
f.match(/^(\.|test|spec|features)/) || f.match(/^*.tar\.gz/)
|
21
19
|
end
|
22
20
|
s.homepage = "https://github.com/logicminds/rubyipmi"
|
23
|
-
s.
|
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.
|
28
|
-
s.
|
29
|
-
s.add_development_dependency
|
30
|
-
s.add_development_dependency
|
31
|
-
s.add_development_dependency
|
32
|
-
s.
|
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.
|
4
|
+
version: 0.12.0
|
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:
|
13
|
+
name: observer
|
15
14
|
requirement: !ruby/object:Gem::Requirement
|
16
15
|
requirements:
|
17
16
|
- - "~>"
|
18
17
|
- !ruby/object:Gem::Version
|
19
|
-
version:
|
20
|
-
type: :
|
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:
|
25
|
+
version: 0.1.0
|
27
26
|
- !ruby/object:Gem::Dependency
|
28
|
-
name:
|
27
|
+
name: logger
|
29
28
|
requirement: !ruby/object:Gem::Requirement
|
30
29
|
requirements:
|
31
|
-
- - "
|
30
|
+
- - ">="
|
32
31
|
- !ruby/object:Gem::Version
|
33
|
-
version: '
|
34
|
-
type: :
|
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: '
|
39
|
+
version: '0'
|
41
40
|
- !ruby/object:Gem::Dependency
|
42
|
-
name:
|
41
|
+
name: rspec
|
43
42
|
requirement: !ruby/object:Gem::Requirement
|
44
43
|
requirements:
|
45
44
|
- - ">="
|
46
45
|
- !ruby/object:Gem::Version
|
47
|
-
version:
|
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:
|
53
|
+
version: '0'
|
55
54
|
- !ruby/object:Gem::Dependency
|
56
|
-
name:
|
55
|
+
name: rdoc
|
57
56
|
requirement: !ruby/object:Gem::Requirement
|
58
57
|
requirements:
|
59
|
-
- - "
|
58
|
+
- - "~>"
|
60
59
|
- !ruby/object:Gem::Version
|
61
|
-
version: '
|
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: '
|
67
|
+
version: '6.1'
|
69
68
|
- !ruby/object:Gem::Dependency
|
70
|
-
name:
|
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
|
-
|
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,11 +121,7 @@ extra_rdoc_files:
|
|
102
121
|
- LICENSE.txt
|
103
122
|
- README.md
|
104
123
|
files:
|
105
|
-
-
|
106
|
-
- ".gitignore"
|
107
|
-
- ".rspec"
|
108
|
-
- ".rubocop.yml"
|
109
|
-
- ".travis.yml"
|
124
|
+
- CONTRIBUTORS.md
|
110
125
|
- Gemfile
|
111
126
|
- LICENSE.txt
|
112
127
|
- README.md
|
@@ -145,9 +160,8 @@ files:
|
|
145
160
|
- rubyipmi.gemspec
|
146
161
|
homepage: https://github.com/logicminds/rubyipmi
|
147
162
|
licenses:
|
148
|
-
-
|
163
|
+
- LGPL-2.1-only
|
149
164
|
metadata: {}
|
150
|
-
post_install_message:
|
151
165
|
rdoc_options: []
|
152
166
|
require_paths:
|
153
167
|
- lib
|
@@ -162,8 +176,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
162
176
|
- !ruby/object:Gem::Version
|
163
177
|
version: '0'
|
164
178
|
requirements: []
|
165
|
-
rubygems_version: 3.
|
166
|
-
signing_key:
|
179
|
+
rubygems_version: 3.6.2
|
167
180
|
specification_version: 4
|
168
181
|
summary: A ruby wrapper for ipmi command line tools that supports ipmitool and freeipmi
|
169
182
|
test_files: []
|
data/.document
DELETED
data/.gitignore
DELETED
@@ -1,50 +0,0 @@
|
|
1
|
-
# rcov generated
|
2
|
-
coverage
|
3
|
-
coverage.data
|
4
|
-
.idea/
|
5
|
-
# rdoc generated
|
6
|
-
rdoc
|
7
|
-
.vagrant/
|
8
|
-
# yard generated
|
9
|
-
doc
|
10
|
-
.yardoc
|
11
|
-
Gemfile.lock
|
12
|
-
# bundler
|
13
|
-
.bundle
|
14
|
-
Gemfile.lock
|
15
|
-
|
16
|
-
# jeweler generated
|
17
|
-
pkg
|
18
|
-
.vagrant
|
19
|
-
# Have editor/IDE/OS specific files you need to ignore? Consider using a global gitignore:
|
20
|
-
#
|
21
|
-
# * Create a file at ~/.gitignore
|
22
|
-
# * Include files you want ignored
|
23
|
-
# * Run: git config --global core.excludesfile ~/.gitignore
|
24
|
-
#
|
25
|
-
# After doing this, these files will be ignored in all your git projects,
|
26
|
-
# saving you from having to 'pollute' every project you touch with them
|
27
|
-
#
|
28
|
-
# Not sure what to needs to be ignored for particular editors/OSes? Here's some ideas to get you started. (Remember, remove the leading # of the line)
|
29
|
-
#
|
30
|
-
# For MacOS:
|
31
|
-
#
|
32
|
-
#.DS_Store
|
33
|
-
|
34
|
-
# For TextMate
|
35
|
-
#*.tmproj
|
36
|
-
#tmtags
|
37
|
-
|
38
|
-
# For emacs:
|
39
|
-
#*~
|
40
|
-
#\#*
|
41
|
-
#.\#*
|
42
|
-
|
43
|
-
# For vim:
|
44
|
-
#*.swp
|
45
|
-
|
46
|
-
# For redcar:
|
47
|
-
#.redcar
|
48
|
-
|
49
|
-
# For rubinius:
|
50
|
-
#*.rbc
|
data/.rspec
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
--color
|
data/.rubocop.yml
DELETED
@@ -1,66 +0,0 @@
|
|
1
|
-
Style/StringLiterals:
|
2
|
-
Enabled: false
|
3
|
-
AllCops:
|
4
|
-
Exclude:
|
5
|
-
- 'rubyipmi.gemspec'
|
6
|
-
SignalException:
|
7
|
-
EnforcedStyle: only_raise
|
8
|
-
Documentation:
|
9
|
-
Enabled: false
|
10
|
-
ClassAndModuleChildren:
|
11
|
-
Enabled: false
|
12
|
-
HashSyntax:
|
13
|
-
EnforcedStyle: hash_rockets
|
14
|
-
ClassCheck:
|
15
|
-
EnforcedStyle: kind_of?
|
16
|
-
SpaceInsideHashLiteralBraces:
|
17
|
-
EnforcedStyle: no_space
|
18
|
-
Style/WordArray:
|
19
|
-
Enabled: false
|
20
|
-
|
21
|
-
|
22
|
-
# TODO: fix these
|
23
|
-
Metrics/AbcSize:
|
24
|
-
Max: 60
|
25
|
-
Metrics/CyclomaticComplexity:
|
26
|
-
Max: 19
|
27
|
-
Metrics/LineLength:
|
28
|
-
Max: 149
|
29
|
-
Metrics/MethodLength:
|
30
|
-
Max: 44
|
31
|
-
Metrics/ModuleLength:
|
32
|
-
Max: 128
|
33
|
-
Metrics/PerceivedComplexity:
|
34
|
-
Max: 22
|
35
|
-
Style/SpecialGlobalVars:
|
36
|
-
Exclude:
|
37
|
-
- 'lib/rubyipmi.rb'
|
38
|
-
- 'lib/rubyipmi/commands/basecommand.rb'
|
39
|
-
- 'lib/rubyipmi/freeipmi/commands/fru.rb'
|
40
|
-
- 'lib/rubyipmi/ipmitool/commands/fru.rb'
|
41
|
-
Style/RescueModifier:
|
42
|
-
Exclude:
|
43
|
-
- 'lib/rubyipmi.rb'
|
44
|
-
Style/RegexpLiteral:
|
45
|
-
Exclude:
|
46
|
-
- 'spec/spec_helper.rb'
|
47
|
-
Style/PredicateName:
|
48
|
-
Exclude:
|
49
|
-
- 'lib/rubyipmi.rb'
|
50
|
-
Lint/RescueException:
|
51
|
-
Exclude:
|
52
|
-
- 'spec/integration/rubyipmi_spec.rb'
|
53
|
-
Style/AccessorMethodName:
|
54
|
-
Exclude:
|
55
|
-
- 'lib/rubyipmi/freeipmi/connection.rb'
|
56
|
-
- 'lib/rubyipmi/ipmitool/connection.rb'
|
57
|
-
|
58
|
-
# Fixed by deprecation
|
59
|
-
Style/MethodName:
|
60
|
-
Exclude:
|
61
|
-
- 'lib/rubyipmi/commands/mixins/power_mixin.rb'
|
62
|
-
|
63
|
-
# Don't understand
|
64
|
-
Style/FileName:
|
65
|
-
Exclude:
|
66
|
-
- 'spec/unit/freeipmi/bmc-info_spec.rb'
|