Class: Commands::SSHCommand
- Inherits:
-
AbstractSSHCommand
- Object
- Command
- AbstractSSHCommand
- Commands::SSHCommand
- Defined in:
- lib/commands.rb
Constant Summary
Constants inherited from AbstractSSHCommand
AbstractSSHCommand::CLOSED_DOWN_STATES, AbstractSSHCommand::WAITING_OR_RUNNING_STATES
Instance Attribute Summary collapse
-
#cmd ⇒ Object
Returns the value of attribute cmd.
Attributes inherited from AbstractSSHCommand
#dest, #hostname, #jobflow_detail, #jobflow_id, #key_pair_file, #no_wait
Attributes inherited from Command
#arg, #commands, #description, #logger, #name
Instance Method Summary collapse
- #enact(client) ⇒ Object
-
#initialize(*args) ⇒ SSHCommand
constructor
A new instance of SSHCommand.
Methods inherited from AbstractSSHCommand
Methods inherited from Command
#get_field, #has_value, #have, #option, #require, #require_single_jobflow, #resolve, #validate
Constructor Details
#initialize(*args) ⇒ SSHCommand
Returns a new instance of SSHCommand.
610 611 612 613 614 615 616 617 |
# File 'lib/commands.rb', line 610 def initialize(*args) super(*args) if @arg =~ /j-[A-Z0-9]{8,20}/ then commands.[:jobflow] << @arg else self.cmd = @arg end end |
Instance Attribute Details
#cmd ⇒ Object
Returns the value of attribute cmd.
608 609 610 |
# File 'lib/commands.rb', line 608 def cmd @cmd end |
Instance Method Details
#enact(client) ⇒ Object
619 620 621 622 |
# File 'lib/commands.rb', line 619 def enact(client) super(client) exec "ssh -i #{key_pair_file} hadoop@#{hostname} #{get_field(:cmd, "")}" end |