class SSHCommand
Executes commands in a remote machine ussing ssh. See documentation for GenericCommand
Attributes
host[RW]
Public Class Methods
new(command, host, logger=nil, stdin=nil, timeout=nil)
click to toggle source
This one takes another parameter. host
is the machine where the command is going to be executed
Calls superclass method
GenericCommand::new
# File lib/CommandManager.rb, line 206 def initialize(command, host, logger=nil, stdin=nil, timeout=nil) @host=host super(command, logger, stdin, timeout) end
run(command, host, logger=nil, stdin=nil, timeout=nil)
click to toggle source
Creates a command and runs it
# File lib/CommandManager.rb, line 198 def self.run(command, host, logger=nil, stdin=nil, timeout=nil) cmd=self.new(command, host, logger, stdin, timeout) cmd.run cmd end
Private Instance Methods
execute()
click to toggle source
# File lib/CommandManager.rb, line 213 def execute if @stdin capture3_timeout("ssh #{@host} #{@command}", :pgroup => true, :stdin_data => @stdin) else capture3_timeout("ssh -n #{@host} #{@command}", :pgroup => true) end end