rubyipmi 0.9.3 → 0.10.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/README.md +27 -20
- data/RELEASE_NOTES.md +5 -0
- data/VERSION +1 -1
- data/lib/rubyipmi.rb +4 -4
- data/rubyipmi.gemspec +2 -2
- data/spec/unit/freeipmi/bmc-info_spec.rb +2 -2
- data/spec/unit/freeipmi/connection_spec.rb +3 -2
- data/spec/unit/freeipmi/fru_spec.rb +1 -1
- data/spec/unit/freeipmi/sensors_spec.rb +1 -1
- data/spec/unit/ipmitool/connection_spec.rb +2 -1
- data/spec/unit/ipmitool/fru_spec.rb +1 -1
- data/spec/unit/ipmitool/lan_spec.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3ed850aa093b990a1aa90dd18715c163e69a1d5f
|
4
|
+
data.tar.gz: d26e0b37395b5c94054c5fa8287b02cf3a7b96eb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e0fba60554b048d68386581a7cb9a798c07257fd752f35ab8d0432d96bcddd7c4cf657818cc4cd2a0ac7257900e3d98af990ba4d190df626d6347510f926e8cc
|
7
|
+
data.tar.gz: dfb8e7a813fd20f2f1a8ff61e8b532fae46db6214cdc54b959bf960efb506d2865badbafc7b5b90b9c49c3f88a3362b4b11e2ebb82a0984a1af323819d7006f1
|
data/README.md
CHANGED
@@ -78,39 +78,46 @@ from the standard. In general this library should work will all servers.
|
|
78
78
|
1. Install the freeipmi from source (http://www.gnu.org/software/freeipmi/) or ipmitool
|
79
79
|
2. `gem install rubyipmi`
|
80
80
|
|
81
|
-
|
81
|
+
### Create a connection object
|
82
82
|
|
83
83
|
```ruby
|
84
84
|
require 'rubyipmi'
|
85
85
|
conn = Rubyipmi.connect("username", "password", "hostname", "providertype")
|
86
|
-
|
87
86
|
```
|
88
87
|
|
89
|
-
|
88
|
+
Additionally, if your using [openipmi](http://openipmi.sourceforge.net) and will be using rubyipmi to connect to
|
89
|
+
the
localhost you can utilize the openipmi driver and not have to pass in any connection parameters.
|
90
|
+
Openipmi works
by installing a driver and makes it available to the host. Freeipmi/Ipmitool will then try to use
|
91
|
+
this driver to
automatically use the openipmi if no host is given. The one caveat here is that you cannot control
|
92
|
+
remote hosts using
openipmi. The rubyipmi code must be executed on the host you want to control.
|
93
|
+
The upside is that you don't need
any credentials. Some commands may require root privileges to run when using openipmi.
|
94
|
+
|
95
|
+
Providertype: optional
|
96
|
+
|
97
|
+
valid options: 'auto', 'ipmitool', 'freeipmi'
|
90
98
|
|
91
99
|
If you don't specify the provider type, Rubyipmi will detect if freeipmi or ipmitool
|
92
100
|
is installed and load the first tool found. If you specify the provider type rubyipmi will only use that specific
|
93
101
|
provider.
|
94
102
|
|
95
|
-
|
96
|
-
localhost you can utilize the openipmi driver and not have to pass in any connection parameters. Openipmi works
|
97
|
-
by installing a driver and makes it available to the host. Freeipmi/Ipmitool will then try to use this driver to
|
98
|
-
automatically use the openipmi if no host is given. The one caveat here is that you cannot control remote hosts using
|
99
|
-
openipmi. The rubyipmi code must be executed on the host you want to control. The upside is that you don't need
|
100
|
-
any credentials. Some commands may require root privileges to run when using openipmi.
|
101
|
-
|
103
|
+
You can specify additional options by passing an options hash into the connection method
|
102
104
|
```ruby
|
103
|
-
conn = Rubyipmi.connect
|
104
|
-
conn.power.status
|
105
|
+
conn = Rubyipmi.connect("username", "password", "hostname", 'freeipmi', {:privilege =>'USER', :driver => 'lan20'})
|
105
106
|
```
|
106
107
|
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
108
|
+
Privilege
|
109
|
+
|
110
|
+
This option controls the role of the user making the ipmi call.
|
111
|
+
valid options: 'CALLBACK', 'USER', 'OPERATOR', 'ADMINISTRATOR' -- defaults to nil and uses the freeipmi/ipmitool default
|
112
|
+
|
113
|
+
Driver
|
114
|
+
|
115
|
+
This option allows you to control which driver to use when making IPMI calls. Selecting auto will choose
|
116
|
+
either lan15 or lan20 based on your device. The open type is when using openipmi in conjunction with the provider.
|
117
|
+
valid options: "auto", "lan15", "lan20", "open" -- defaults to lan20
|
111
118
|
|
112
119
|
|
113
|
-
|
120
|
+
### power functions
|
114
121
|
|
115
122
|
```ruby
|
116
123
|
require 'rubyipmi'
|
@@ -123,7 +130,7 @@ from the standard. In general this library should work will all servers.
|
|
123
130
|
|
124
131
|
```
|
125
132
|
|
126
|
-
|
133
|
+
### Boot to specific device
|
127
134
|
|
128
135
|
```ruby
|
129
136
|
require 'rubyipmi'
|
@@ -134,7 +141,7 @@ from the standard. In general this library should work will all servers.
|
|
134
141
|
```
|
135
142
|
|
136
143
|
|
137
|
-
|
144
|
+
### Sensors
|
138
145
|
|
139
146
|
```ruby
|
140
147
|
require 'rubyipmi'
|
@@ -145,7 +152,7 @@ from the standard. In general this library should work will all servers.
|
|
145
152
|
|
146
153
|
```
|
147
154
|
|
148
|
-
|
155
|
+
### Fru
|
149
156
|
|
150
157
|
```ruby
|
151
158
|
require 'rubyipmi'
|
data/RELEASE_NOTES.md
CHANGED
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.
|
1
|
+
0.10.0
|
data/lib/rubyipmi.rb
CHANGED
@@ -73,12 +73,12 @@ module Rubyipmi
|
|
73
73
|
# If provider is left blank the function will use the first available provider
|
74
74
|
# When the driver is set to auto, rubyipmi will try and figure out which driver to use by common error messages. We will most likely be using
|
75
75
|
# the lan20 driver, but in order to support a wide use case we default to auto.
|
76
|
-
def self.connect(user, pass, host, provider='any', opts={:driver => '
|
76
|
+
def self.connect(user, pass, host, provider='any', opts={:driver => 'lan20', :timeout => 'default'})
|
77
77
|
# use this variable to reduce cmd calls
|
78
78
|
installed = false
|
79
79
|
|
80
80
|
# if the user supplied nil, we want to fix this automatically
|
81
|
-
opts = {:driver => '
|
81
|
+
opts = {:driver => 'lan20', :timeout => 'default'} if opts.nil?
|
82
82
|
|
83
83
|
# convert all keys to symbols for opts, we can't assume the user will use symbols
|
84
84
|
opts.keys.each do |key|
|
@@ -94,7 +94,7 @@ module Rubyipmi
|
|
94
94
|
end
|
95
95
|
|
96
96
|
# Verify options just in case user passed in a incomplete hash
|
97
|
-
opts[:driver] ||= '
|
97
|
+
opts[:driver] ||= 'lan20'
|
98
98
|
opts[:timeout] ||= 'default'
|
99
99
|
|
100
100
|
if opts[:privilege] and not supported_privilege_type?(opts[:privilege])
|
@@ -189,7 +189,7 @@ module Rubyipmi
|
|
189
189
|
end
|
190
190
|
|
191
191
|
# gets data from the bmc device and puts in a hash for diagnostics
|
192
|
-
def self.get_diag(user, pass, host, opts={:driver => '
|
192
|
+
def self.get_diag(user, pass, host, opts={:driver => 'lan20', :timeout => 'default'})
|
193
193
|
data = {}
|
194
194
|
if Rubyipmi.is_provider_installed?('freeipmi')
|
195
195
|
freeconn = Rubyipmi.connect(user, pass, host, 'freeipmi', opts)
|
data/rubyipmi.gemspec
CHANGED
@@ -2,11 +2,11 @@
|
|
2
2
|
# DO NOT EDIT THIS FILE DIRECTLY
|
3
3
|
# Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
|
4
4
|
# -*- encoding: utf-8 -*-
|
5
|
-
# stub: rubyipmi 0.
|
5
|
+
# stub: rubyipmi 0.10.0 ruby lib
|
6
6
|
|
7
7
|
Gem::Specification.new do |s|
|
8
8
|
s.name = "rubyipmi"
|
9
|
-
s.version = "0.
|
9
|
+
s.version = "0.10.0"
|
10
10
|
|
11
11
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
12
12
|
s.require_paths = ["lib"]
|
@@ -27,12 +27,12 @@ describe "Bmc" do
|
|
27
27
|
|
28
28
|
it "cmd should be bmc-info with correct number of arguments" do
|
29
29
|
@bmcinfo.retrieve
|
30
|
-
verify_freeipmi_command(@bmcinfo,
|
30
|
+
verify_freeipmi_command(@bmcinfo, 3, "#{@path}/bmc-info")
|
31
31
|
end
|
32
32
|
|
33
33
|
it "cmd should be bmc-info with correct number of arguments" do
|
34
34
|
@bmcinfo.guid
|
35
|
-
verify_freeipmi_command(@bmcinfo,
|
35
|
+
verify_freeipmi_command(@bmcinfo, 4, "#{@path}/bmc-info")
|
36
36
|
end
|
37
37
|
|
38
38
|
end
|
@@ -50,8 +50,9 @@ describe "Bmc" do
|
|
50
50
|
|
51
51
|
end
|
52
52
|
|
53
|
-
it 'object should have driver set to
|
54
|
-
expect(@conn.options
|
53
|
+
it 'object should have driver set to lan20 if not specified' do
|
54
|
+
expect(@conn.options['driver-type']).to eq "LAN_2_0"
|
55
|
+
|
55
56
|
end
|
56
57
|
|
57
58
|
it 'object should have driver set to auto if not specified' do
|
@@ -32,7 +32,7 @@ describe :Sensors do
|
|
32
32
|
|
33
33
|
it "cmd should be ipmi-sensors with six arguments" do
|
34
34
|
@sensors.list
|
35
|
-
verify_freeipmi_command(@sensors,
|
35
|
+
verify_freeipmi_command(@sensors, 6, "#{@path}/ipmi-sensors")
|
36
36
|
end
|
37
37
|
|
38
38
|
it "can return a list of sensors" do
|
@@ -51,7 +51,8 @@ describe :Connection do
|
|
51
51
|
end
|
52
52
|
|
53
53
|
it 'object should have driver set to auto if not specified' do
|
54
|
-
expect(@conn.options
|
54
|
+
expect(@conn.options['I']).to eq 'lanplus'
|
55
|
+
|
55
56
|
end
|
56
57
|
|
57
58
|
it 'object should have driver set to auto if not specified' do
|
@@ -30,7 +30,7 @@ describe :Fru do
|
|
30
30
|
|
31
31
|
it "cmd should be ipmi-sensors with correct number of arguments" do
|
32
32
|
@fru.list
|
33
|
-
verify_ipmitool_command(@fru,
|
33
|
+
verify_ipmitool_command(@fru, 4, "#{@path}/ipmitool", 'fru')
|
34
34
|
end
|
35
35
|
|
36
36
|
it 'should return a list of unparsed frus' do
|
@@ -27,7 +27,7 @@ describe "Lan" do
|
|
27
27
|
|
28
28
|
it "cmd should be lan with correct number of arguments" do
|
29
29
|
@lan.info
|
30
|
-
verify_ipmitool_command(@lan,
|
30
|
+
verify_ipmitool_command(@lan, 4, "#{@path}/ipmitool", 'lanplus')
|
31
31
|
end
|
32
32
|
|
33
33
|
it "can return a lan information" do
|