Class: SSHCommand

Inherits:
GenericCommand show all
Defined in:
lib/CommandManager.rb

Overview

Executes commands in a remote machine ussing ssh. See documentation for GenericCommand

Direct Known Subclasses

RemotesCommand

Constant Summary

Constants inherited from GenericCommand

GenericCommand::ERROR_CLOSE, GenericCommand::ERROR_OPEN

Instance Attribute Summary collapse

Attributes inherited from GenericCommand

#code, #command, #stderr, #stdout

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from GenericCommand

#get_error_message, #log, #run, #to_xml

Constructor Details

#initialize(command, host, logger = nil, stdin = nil, timeout = nil) ⇒ SSHCommand

This one takes another parameter. host is the machine where the command is going to be executed



229
230
231
232
# File 'lib/CommandManager.rb', line 229

def initialize(command, host, logger=nil, stdin=nil, timeout=nil)
    @host=host
    super(command, logger, stdin, timeout)
end

Instance Attribute Details

#hostObject

Returns the value of attribute host.



218
219
220
# File 'lib/CommandManager.rb', line 218

def host
  @host
end

Class Method Details

.run(command, host, logger = nil, stdin = nil, timeout = nil) ⇒ Object

Creates a command and runs it



221
222
223
224
225
# File 'lib/CommandManager.rb', line 221

def self.run(command, host, logger=nil, stdin=nil, timeout=nil)
    cmd=self.new(command, host, logger, stdin, timeout)
    cmd.run
    cmd
end