You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
Never mind - since the exit code of running "raw 0x00" is actually "1", the code works properly as "value" does not get set to true so never returns the output received from BMC.
If change the code to this:
def raw_cmd(opt)
@options["cmdargs"] = "raw #{opt}"
value = runcmd
@options.delete_notify("cmdargs")
@result
end
everything works fine and I get this output:
irb(main):006:0* conn.raw.test
=> "Not enough parameters given.\nRAW Commands: raw <netfn> <cmd> [data]\n\nNetwork Function Codes:\n\n VAL\tHEX\tSTRING\n==============================================\n 0\t0x00\tChassis\n 2\t0x02\tBridge\n 4\t0x04\tSensorEvent\n 6\t0x06\tApplication\n 8\t0x08\tFirmware\n 10\t0x0a\tStorage\n 12\t0x0c\tTransport\n\n(can also use raw hex values)\n"
irb(main):007:0>
Something like this, I'd imagine (very simplified version, but even that does not work for me, so looking for your guidance here):
WIth the following added to lib/rubyipmi/ipmitool/connection.rb
I get the following output:
The text was updated successfully, but these errors were encountered: