Class: ChefMetal::Transport::SSH::SSHResult
- Inherits:
-
Object
- Object
- ChefMetal::Transport::SSH::SSHResult
- Defined in:
- lib/chef_metal/transport/ssh.rb
Instance Attribute Summary collapse
-
#command ⇒ Object
readonly
Returns the value of attribute command.
-
#exitstatus ⇒ Object
readonly
Returns the value of attribute exitstatus.
-
#options ⇒ Object
readonly
Returns the value of attribute options.
-
#stderr ⇒ Object
readonly
Returns the value of attribute stderr.
-
#stdout ⇒ Object
readonly
Returns the value of attribute stdout.
Instance Method Summary collapse
- #error! ⇒ Object
-
#initialize(command, options, stdout, stderr, exitstatus) ⇒ SSHResult
constructor
A new instance of SSHResult.
Constructor Details
#initialize(command, options, stdout, stderr, exitstatus) ⇒ SSHResult
Returns a new instance of SSHResult.
158 159 160 161 162 163 164 |
# File 'lib/chef_metal/transport/ssh.rb', line 158 def initialize(command, , stdout, stderr, exitstatus) @command = command @options = @stdout = stdout @stderr = stderr @exitstatus = exitstatus end |
Instance Attribute Details
#command ⇒ Object (readonly)
Returns the value of attribute command.
166 167 168 |
# File 'lib/chef_metal/transport/ssh.rb', line 166 def command @command end |
#exitstatus ⇒ Object (readonly)
Returns the value of attribute exitstatus.
170 171 172 |
# File 'lib/chef_metal/transport/ssh.rb', line 170 def exitstatus @exitstatus end |
#options ⇒ Object (readonly)
Returns the value of attribute options.
167 168 169 |
# File 'lib/chef_metal/transport/ssh.rb', line 167 def @options end |
#stderr ⇒ Object (readonly)
Returns the value of attribute stderr.
169 170 171 |
# File 'lib/chef_metal/transport/ssh.rb', line 169 def stderr @stderr end |
#stdout ⇒ Object (readonly)
Returns the value of attribute stdout.
168 169 170 |
# File 'lib/chef_metal/transport/ssh.rb', line 168 def stdout @stdout end |
Instance Method Details
#error! ⇒ Object
172 173 174 175 176 177 |
# File 'lib/chef_metal/transport/ssh.rb', line 172 def error! if exitstatus != 0 # TODO stdout/stderr is already printed at info/debug level. Let's not print it twice, it's a lot. msg = "Error: command '#{command}' exited with code #{exitstatus}.\n" end end |