Class: SSHCommand
- Inherits:
-
GenericCommand
- Object
- GenericCommand
- SSHCommand
- Defined in:
- lib/CommandManager.rb
Overview
Executes commands in a remote machine ussing ssh. See documentation for GenericCommand
Direct Known Subclasses
Instance Attribute Summary collapse
-
#host ⇒ Object
Returns the value of attribute host.
-
#ssh_opts ⇒ Object
Returns the value of attribute ssh_opts.
Attributes inherited from GenericCommand
#code, #command, #stderr, #stdout
Class Method Summary collapse
-
.run(command, host, logger = nil, stdin = nil, timeout = nil, ssh_opts = '') ⇒ Object
Creates a command and runs it.
Instance Method Summary collapse
-
#initialize(command, host, logger = nil, stdin = nil, timeout = nil, ssh_opts = '') ⇒ SSHCommand
constructor
This one takes another parameter.
Methods inherited from GenericCommand
#get_error_message, #log, #run, #to_xml
Constructor Details
#initialize(command, host, logger = nil, stdin = nil, timeout = nil, ssh_opts = '') ⇒ SSHCommand
This one takes another parameter. host
is the machine where the command is going to be executed
227 228 229 230 231 232 |
# File 'lib/CommandManager.rb', line 227 def initialize(command, host, logger=nil, stdin=nil, timeout=nil, ssh_opts='') @host=host @ssh_opts = ssh_opts super(command, logger, stdin, timeout) end |
Instance Attribute Details
#host ⇒ Object
Returns the value of attribute host.
216 217 218 |
# File 'lib/CommandManager.rb', line 216 def host @host end |
#ssh_opts ⇒ Object
Returns the value of attribute ssh_opts.
216 217 218 |
# File 'lib/CommandManager.rb', line 216 def ssh_opts @ssh_opts end |
Class Method Details
.run(command, host, logger = nil, stdin = nil, timeout = nil, ssh_opts = '') ⇒ Object
Creates a command and runs it
219 220 221 222 223 |
# File 'lib/CommandManager.rb', line 219 def self.run(command, host, logger=nil, stdin=nil, timeout=nil, ssh_opts='') cmd=self.new(command, host, logger, stdin, timeout, ssh_opts) cmd.run cmd end |