-
Notifications
You must be signed in to change notification settings - Fork 29
Open
Description
Something like this, I'd imagine (very simplified version, but even that does not work for me, so looking for your guidance here):
module Rubyipmi::Ipmitool
class Raw < Rubyipmi::Ipmitool::BaseCommand
def initialize(opts = ObservableHash.new)
super("ipmitool", opts)
end
def raw_cmd(opt)
@options["cmdargs"] = "raw #{opt}"
value = runcmd
@options.delete_notify("cmdargs")
if value
@result
end
end
def test
raw_cmd("0x00")
end
end
end
WIth the following added to lib/rubyipmi/ipmitool/connection.rb
def raw
@raw ||= Rubyipmi::Ipmitool::Raw.new(@options)
end
I get the following output:
# irb
irb(main):001:0> require 'rubyipmi'
=> true
irb(main):002:0> conn = Rubyipmi.connect("root", "root", "<IP>", "ipmitool")
=> #<Rubyipmi::Ipmitool::Connection:0x000000011b2898 @options={"H"=>"<IP>", "U"=>"root", "P"=>"root", "I"=>"lanplus"}>
irb(main):003:0>
irb(main):004:0* conn.raw.test
=> nil
irb(main):005:0>
Metadata
Metadata
Assignees
Labels
No labels