lib/rubyipmi/freeipmi/commands/basecommand.rb in rubyipmi-0.4.0 vs lib/rubyipmi/freeipmi/commands/basecommand.rb in rubyipmi-0.5.0

- old
+ new

@@ -1,17 +1,30 @@ module Rubyipmi::Freeipmi class BaseCommand < Rubyipmi::BaseCommand + def setpass + super + @options["config-file"] = @passfile.path + @passfile.puts "password #{@options["password"]}\n" + @passfile.puts "username #{@options["username"]}" + + @passfile.close + end + def makecommand # need to format the options to freeipmi format args = @options.collect { |k, v| if not v "--#{k}" else "--#{k}=#{v}" end }.join(" ") + # must remove from command line as its handled via conf file + args.delete("--password") + args.delete("--username") + return "#{cmd} #{args}" end # This method will check if the results are really valid as the exit code can be misleading and incorrect \ No newline at end of file