Method: Beaker::SshConnection#execute

Defined in:
lib/beaker/ssh_connection.rb

#execute(command, options = {}, stdout_callback = nil, stderr_callback = stdout_callback) ⇒ Object

Execute a command on a host, ensuring a connection exists first

Parameters:

  • options (Hash{Symbol=>String}) (defaults to: {})

    Options hash to control method conditionals

Options Hash (options):



233
234
235
236
237
238
# File 'lib/beaker/ssh_connection.rb', line 233

def execute command, options = {}, stdout_callback = nil,
            stderr_callback = stdout_callback
  # ensure that we have a current connection object
  connect(options)
  try_to_execute(command, options, stdout_callback, stderr_callback)
end