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

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



206
207
208
209
# File 'lib/CommandManager.rb', line 206

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.



195
196
197
# File 'lib/CommandManager.rb', line 195

def host
  @host
end

Class Method Details

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

Creates a command and runs it



198
199
200
201
202
# 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