Method: Toolshed::Commands::SSH#execute

Defined in:
lib/toolshed/commands/ssh.rb

#execute(args, options = {}) ⇒ Object



47
48
49
50
51
52
53
54
55
56
57
# File 'lib/toolshed/commands/ssh.rb', line 47

def execute(args, options = {})
  Toolshed.logger.info "Running ssh command with options #{options.inspect}" unless options[:verbose_output].nil? || options[:verbose_output].empty? # rubocop:disable Metrics/LineLength
  begin
    ssh = Toolshed::ServerAdministration::SSH.new(options)
    ssh.execute
  rescue => e
    Toolshed.logger.fatal e.message
    Toolshed.logger.fatal "Unable to connect to #{options[:host]}"
    Toolshed.die
  end
end