rubyipmi 0.5.1 → 0.6.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,20 +1,17 @@
1
- Copyright (c) 2012 Corey Osman
1
+ Any questions please contact Corey Osman at corey@logicminds.biz
2
2
 
3
- Permission is hereby granted, free of charge, to any person obtaining
4
- a copy of this software and associated documentation files (the
5
- "Software"), to deal in the Software without restriction, including
6
- without limitation the rights to use, copy, modify, merge, publish,
7
- distribute, sublicense, and/or sell copies of the Software, and to
8
- permit persons to whom the Software is furnished to do so, subject to
9
- the following conditions:
3
+ Copyright (c) 2013 Corey Osman
10
4
 
11
- The above copyright notice and this permission notice shall be
12
- included in all copies or substantial portions of the Software.
5
+ This program is free software: you can redistribute it and/or modify
6
+ it under the terms of the GNU General Public License as published by
7
+ the Free Software Foundation, either version 3 of the License,
8
+ or (at your option) any later version.
13
9
 
14
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
- NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
- LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
- OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
- WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
10
+ This program is distributed in the hope that it will be useful,
11
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
12
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
13
+ See the GNU General Public License for more details.
14
+
15
+ You should have received a copy of the GNU General Public
16
+ License along with this program.
17
+ If not, see http://www.gnu.org/licenses/.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.5.1
1
+ 0.6.0
@@ -18,6 +18,10 @@ module Rubyipmi::Freeipmi
18
18
  end
19
19
  end
20
20
 
21
+ def reset(type='cold')
22
+ device.reset(type)
23
+ end
24
+
21
25
  def guid
22
26
  information.guid
23
27
  end
@@ -31,7 +35,12 @@ module Rubyipmi::Freeipmi
31
35
  end
32
36
 
33
37
  def information
34
- @info ||= Rubyipmi::Freeipmi::BmcInfo.new(@options)
38
+ @info ||= Rubyipmi::Freeipmi::BmcInfo.new(options)
35
39
  end
40
+
41
+ def device
42
+ @bmcdevice ||= Rubyipmi::Freeipmi::BmcDevice.new(options)
43
+ end
44
+
36
45
  end
37
46
  end
@@ -0,0 +1,32 @@
1
+ module Rubyipmi::Freeipmi
2
+
3
+ class BmcDevice < Rubyipmi::Freeipmi::BaseCommand
4
+
5
+ def initialize(opts = ObservableHash.new)
6
+ super("bmc-device", opts)
7
+ end
8
+
9
+ # runs a command like bmc-device --cold-reset
10
+ def command(opt)
11
+ @options[opt] = false
12
+ value = runcmd
13
+ @options.delete_notify(opt)
14
+ return value
15
+ end
16
+
17
+ # reset the bmc device, useful for debugging and troubleshooting
18
+ def reset(type='cold')
19
+ if ['cold', 'warm'].include?(type)
20
+ key = "#{type}-reset"
21
+ command(key)
22
+ else
23
+ raise "reset type: #{type} is not a valid choice, use warm or cold"
24
+ end
25
+ end
26
+
27
+
28
+
29
+ end
30
+
31
+
32
+ end
@@ -21,6 +21,19 @@ module Rubyipmi::Ipmitool
21
21
  end
22
22
  end
23
23
 
24
+ # reset the bmc device, useful for troubleshooting
25
+ def reset(type='cold')
26
+ if ['cold', 'warm'].include?(type)
27
+ @options["cmdargs"] = "bmc reset #{type}"
28
+ value = runcmd()
29
+ @options.delete_notify("cmdargs")
30
+ return value
31
+ else
32
+ raise "reset type: #{type} is not a valid choice, use warm or cold"
33
+ end
34
+
35
+ end
36
+
24
37
  def guid
25
38
  @options["cmdargs"] = "bmc guid"
26
39
  value = runcmd()
@@ -23,8 +23,9 @@ module Rubyipmi
23
23
  # So they are not required
24
24
  @options["U"] = user if user
25
25
  @options["P"] = pass if pass
26
- # default to IPMI 2.0 communication
27
- #@options["I"] = "lanplus"
26
+ # default to IPMI 2.0 communication, this means that older devices will not work
27
+ # Those old servers should be recycled by now, as the 1.0, 1.5 spec came out in 2005ish and is 2013.
28
+ @options["I"] = "lanplus"
28
29
 
29
30
  #getWorkArounds
30
31
  end
@@ -4,14 +4,14 @@
4
4
  # -*- encoding: utf-8 -*-
5
5
 
6
6
  Gem::Specification.new do |s|
7
- s.name = "rubyipmi"
8
- s.version = "0.5.1"
7
+ s.name = %q{rubyipmi}
8
+ s.version = "0.6.0"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Corey Osman"]
12
- s.date = "2013-04-03"
13
- s.description = "A ruby wrapper for ipmi command line tools that supports ipmitool and freeipmi"
14
- s.email = "corey@logicminds.biz"
12
+ s.date = %q{2013-07-03}
13
+ s.description = %q{A ruby wrapper for ipmi command line tools that supports ipmitool and freeipmi}
14
+ s.email = %q{corey@logicminds.biz}
15
15
  s.extra_rdoc_files = [
16
16
  "LICENSE.txt",
17
17
  "README.md",
@@ -32,6 +32,7 @@ Gem::Specification.new do |s|
32
32
  "lib/rubyipmi/freeipmi/commands/basecommand.rb",
33
33
  "lib/rubyipmi/freeipmi/commands/bmc.rb",
34
34
  "lib/rubyipmi/freeipmi/commands/bmcconfig.rb",
35
+ "lib/rubyipmi/freeipmi/commands/bmcdevice.rb",
35
36
  "lib/rubyipmi/freeipmi/commands/bmcinfo.rb",
36
37
  "lib/rubyipmi/freeipmi/commands/chassis.rb",
37
38
  "lib/rubyipmi/freeipmi/commands/chassisconfig.rb",
@@ -64,16 +65,17 @@ Gem::Specification.new do |s|
64
65
  "spec/sensor_spec.rb",
65
66
  "spec/spec_helper.rb"
66
67
  ]
67
- s.homepage = "http://github.com/logicminds/rubyipmi"
68
+ s.homepage = %q{http://github.com/logicminds/rubyipmi}
68
69
  s.licenses = ["GPLv3"]
69
70
  s.require_paths = ["lib"]
70
- s.rubygems_version = "1.8.24"
71
- s.summary = "A ruby wrapper for ipmi command line tools that supports ipmitool and freeipmi"
71
+ s.rubygems_version = %q{1.3.6}
72
+ s.summary = %q{A ruby wrapper for ipmi command line tools that supports ipmitool and freeipmi}
72
73
 
73
74
  if s.respond_to? :specification_version then
75
+ current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
74
76
  s.specification_version = 3
75
77
 
76
- if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
78
+ if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
77
79
  s.add_development_dependency(%q<rspec>, ["~> 2.8.0"])
78
80
  s.add_development_dependency(%q<rdoc>, ["~> 3.12"])
79
81
  s.add_development_dependency(%q<bundler>, ["~> 1.1.5"])
@@ -23,6 +23,17 @@ describe "Bmc" do
23
23
  # before.length.should be < after.length
24
24
  #end
25
25
 
26
+ it "should reset the bmc device" do
27
+ @conn.bmc.reset('cold').should_not be_nil
28
+ end
29
+
30
+ it "should reset the bmc device warmly" do
31
+ @conn.bmc.reset('warm').should_not be_nil
32
+ end
33
+
34
+ it "reset should fail when type is wrong" do
35
+ @conn.bmc.reset('freezing').should_be nil
36
+ end
26
37
 
27
38
  it "is able to retrieve the bmc info" do
28
39
  @conn.bmc.info.should_not be_nil
metadata CHANGED
@@ -1,13 +1,12 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rubyipmi
3
3
  version: !ruby/object:Gem::Version
4
- hash: 9
5
- prerelease:
4
+ prerelease: false
6
5
  segments:
7
6
  - 0
8
- - 5
9
- - 1
10
- version: 0.5.1
7
+ - 6
8
+ - 0
9
+ version: 0.6.0
11
10
  platform: ruby
12
11
  authors:
13
12
  - Corey Osman
@@ -15,85 +14,76 @@ autorequire:
15
14
  bindir: bin
16
15
  cert_chain: []
17
16
 
18
- date: 2013-04-03 00:00:00 Z
17
+ date: 2013-07-03 00:00:00 -07:00
18
+ default_executable:
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
21
- requirement: &id001 !ruby/object:Gem::Requirement
22
- none: false
21
+ type: :development
22
+ version_requirements: &id001 !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - ~>
25
25
  - !ruby/object:Gem::Version
26
- hash: 47
27
26
  segments:
28
27
  - 2
29
28
  - 8
30
29
  - 0
31
30
  version: 2.8.0
32
- prerelease: false
33
- type: :development
34
31
  name: rspec
35
- version_requirements: *id001
32
+ requirement: *id001
33
+ prerelease: false
36
34
  - !ruby/object:Gem::Dependency
37
- requirement: &id002 !ruby/object:Gem::Requirement
38
- none: false
35
+ type: :development
36
+ version_requirements: &id002 !ruby/object:Gem::Requirement
39
37
  requirements:
40
38
  - - ~>
41
39
  - !ruby/object:Gem::Version
42
- hash: 31
43
40
  segments:
44
41
  - 3
45
42
  - 12
46
43
  version: "3.12"
47
- prerelease: false
48
- type: :development
49
44
  name: rdoc
50
- version_requirements: *id002
45
+ requirement: *id002
46
+ prerelease: false
51
47
  - !ruby/object:Gem::Dependency
52
- requirement: &id003 !ruby/object:Gem::Requirement
53
- none: false
48
+ type: :development
49
+ version_requirements: &id003 !ruby/object:Gem::Requirement
54
50
  requirements:
55
51
  - - ~>
56
52
  - !ruby/object:Gem::Version
57
- hash: 25
58
53
  segments:
59
54
  - 1
60
55
  - 1
61
56
  - 5
62
57
  version: 1.1.5
63
- prerelease: false
64
- type: :development
65
58
  name: bundler
66
- version_requirements: *id003
59
+ requirement: *id003
60
+ prerelease: false
67
61
  - !ruby/object:Gem::Dependency
68
- requirement: &id004 !ruby/object:Gem::Requirement
69
- none: false
62
+ type: :development
63
+ version_requirements: &id004 !ruby/object:Gem::Requirement
70
64
  requirements:
71
65
  - - ~>
72
66
  - !ruby/object:Gem::Version
73
- hash: 63
74
67
  segments:
75
68
  - 1
76
69
  - 8
77
70
  - 4
78
71
  version: 1.8.4
79
- prerelease: false
80
- type: :development
81
72
  name: jeweler
82
- version_requirements: *id004
73
+ requirement: *id004
74
+ prerelease: false
83
75
  - !ruby/object:Gem::Dependency
84
- requirement: &id005 !ruby/object:Gem::Requirement
85
- none: false
76
+ type: :development
77
+ version_requirements: &id005 !ruby/object:Gem::Requirement
86
78
  requirements:
87
79
  - - ">="
88
80
  - !ruby/object:Gem::Version
89
- hash: 3
90
81
  segments:
91
82
  - 0
92
83
  version: "0"
93
- prerelease: false
94
- type: :development
95
84
  name: rcov
96
- version_requirements: *id005
85
+ requirement: *id005
86
+ prerelease: false
97
87
  description: A ruby wrapper for ipmi command line tools that supports ipmitool and freeipmi
98
88
  email: corey@logicminds.biz
99
89
  executables: []
@@ -119,6 +109,7 @@ files:
119
109
  - lib/rubyipmi/freeipmi/commands/basecommand.rb
120
110
  - lib/rubyipmi/freeipmi/commands/bmc.rb
121
111
  - lib/rubyipmi/freeipmi/commands/bmcconfig.rb
112
+ - lib/rubyipmi/freeipmi/commands/bmcdevice.rb
122
113
  - lib/rubyipmi/freeipmi/commands/bmcinfo.rb
123
114
  - lib/rubyipmi/freeipmi/commands/chassis.rb
124
115
  - lib/rubyipmi/freeipmi/commands/chassisconfig.rb
@@ -150,6 +141,7 @@ files:
150
141
  - spec/rubyipmi_spec.rb
151
142
  - spec/sensor_spec.rb
152
143
  - spec/spec_helper.rb
144
+ has_rdoc: true
153
145
  homepage: http://github.com/logicminds/rubyipmi
154
146
  licenses:
155
147
  - GPLv3
@@ -159,27 +151,23 @@ rdoc_options: []
159
151
  require_paths:
160
152
  - lib
161
153
  required_ruby_version: !ruby/object:Gem::Requirement
162
- none: false
163
154
  requirements:
164
155
  - - ">="
165
156
  - !ruby/object:Gem::Version
166
- hash: 3
167
157
  segments:
168
158
  - 0
169
159
  version: "0"
170
160
  required_rubygems_version: !ruby/object:Gem::Requirement
171
- none: false
172
161
  requirements:
173
162
  - - ">="
174
163
  - !ruby/object:Gem::Version
175
- hash: 3
176
164
  segments:
177
165
  - 0
178
166
  version: "0"
179
167
  requirements: []
180
168
 
181
169
  rubyforge_project:
182
- rubygems_version: 1.8.24
170
+ rubygems_version: 1.3.6
183
171
  signing_key:
184
172
  specification_version: 3
185
173
  summary: A ruby wrapper for ipmi command line tools that supports ipmitool and freeipmi