class NodeSpec::BackendProxy::Ssh
Constants
- ROOT_USER
Public Class Methods
new(ssh)
click to toggle source
# File lib/nodespec/backend_proxy/ssh.rb, line 11 def initialize(ssh) @ssh_session = ssh end
Public Instance Methods
execute(command)
click to toggle source
# File lib/nodespec/backend_proxy/ssh.rb, line 15 def execute(command) command = run_as_sudo(command) if @ssh_session.options[:user] != ROOT_USER execute_within_timeout(command) do success = true @ssh_session.exec!(command) do |ch, stream, data| verbose_puts(data) success = stream != :stderr end success end end