rubyipmi 0.9.3 → 0.10.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 73a317277673e2c70ada368153734878751b0697
4
- data.tar.gz: ca3ae9b2f301a9ed9c4327af190912dc16525e73
3
+ metadata.gz: 3ed850aa093b990a1aa90dd18715c163e69a1d5f
4
+ data.tar.gz: d26e0b37395b5c94054c5fa8287b02cf3a7b96eb
5
5
  SHA512:
6
- metadata.gz: 4b09be14a0edc2c20bc479f4e430311f081daa98601cc064ced0e69b680b8f5c637ecbaf05c505ddf164d7d42ffd9dd7aee8d39f0d03dcf3a36b7b0327257f1a
7
- data.tar.gz: c56d4d03854fa96d484c515a6e2ac05d47be8fc7f578846901c08a2807fa893a4454ca775e08ff0d57120329b6272edd9afed05c67efa80c66fcbd4426982b10
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
- #### Create a connection object
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
- Providertype: optional (ipmitool or freeipmi)
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
- Additionally, if your using [openipmi](http://openipmi.sourceforge.net) and will be using rubyipmi to connect to the
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
- Should you need to specify some additional options or the provider type
108
- ```ruby
109
- conn = Rubyipmi.connect("username", "password", "hostname", 'freeipmi', {:privilege =>'USER'})
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
- #### power functions
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
- #### Boot to specific device
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
- #### Sensors
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
- #### Fru
155
+ ### Fru
149
156
 
150
157
  ```ruby
151
158
  require 'rubyipmi'
@@ -1,3 +1,8 @@
1
+ ### 0.10.0
2
+ * gh-26 - make the driver default to lan20
3
+
4
+ Users of older IPMI devices will now need to pass the specified driver type.
5
+
1
6
  ### 0.9.3
2
7
  * normalize the options being passed into the connect method
3
8
 
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.9.3
1
+ 0.10.0
@@ -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 => 'auto', :timeout => 'default'})
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 => 'auto', :timeout => 'default'} if opts.nil?
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] ||= 'auto'
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 => 'auto', :timeout => 'default'})
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)
@@ -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.9.3 ruby lib
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.3"
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, 2, "#{@path}/bmc-info")
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, 3, "#{@path}/bmc-info")
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 auto if not specified' do
54
- expect(@conn.options.has_key?('driver-type')).to eq false
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
@@ -28,7 +28,7 @@ describe :Fru do
28
28
 
29
29
  it "cmd should be ipmi-fru with correct number of arguments" do
30
30
  @fru.list
31
- verify_freeipmi_command(@fru, 2, "#{@path}/ipmi-fru")
31
+ verify_freeipmi_command(@fru, 3, "#{@path}/ipmi-fru")
32
32
  end
33
33
 
34
34
  it 'should list data' 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, 5, "#{@path}/ipmi-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.has_key?('driver-type')).to eq false
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, 3, "#{@path}/ipmitool", '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, 3, "#{@path}/ipmitool", 'lan')
30
+ verify_ipmitool_command(@lan, 4, "#{@path}/ipmitool", 'lanplus')
31
31
  end
32
32
 
33
33
  it "can return a lan information" do
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rubyipmi
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.3
4
+ version: 0.10.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Corey Osman