Class: ChefMetal::Transport::SSH::SSHResult

Inherits:
Object
  • Object
show all
Defined in:
lib/chef_metal/transport/ssh.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(stdout, stderr, exitstatus) ⇒ SSHResult

Returns a new instance of SSHResult.



149
150
151
152
153
# File 'lib/chef_metal/transport/ssh.rb', line 149

def initialize(stdout, stderr, exitstatus)
  @stdout = stdout
  @stderr = stderr
  @exitstatus = exitstatus
end

Instance Attribute Details

#exitstatusObject (readonly)

Returns the value of attribute exitstatus.



157
158
159
# File 'lib/chef_metal/transport/ssh.rb', line 157

def exitstatus
  @exitstatus
end

#stderrObject (readonly)

Returns the value of attribute stderr.



156
157
158
# File 'lib/chef_metal/transport/ssh.rb', line 156

def stderr
  @stderr
end

#stdoutObject (readonly)

Returns the value of attribute stdout.



155
156
157
# File 'lib/chef_metal/transport/ssh.rb', line 155

def stdout
  @stdout
end

Instance Method Details

#error!Object



159
160
161
# File 'lib/chef_metal/transport/ssh.rb', line 159

def error!
  raise "Error: code #{exitstatus}.\nSTDOUT:#{stdout}\nSTDERR:#{stderr}" if exitstatus != 0
end