Class: Chef::Provisioning::DockerDriver::DockerTransport::DockerResult
- Inherits:
-
Object
- Object
- Chef::Provisioning::DockerDriver::DockerTransport::DockerResult
- Defined in:
- lib/chef/provisioning/docker_driver/docker_transport.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) ⇒ DockerResult
constructor
A new instance of DockerResult.
Constructor Details
#initialize(command, options, stdout, stderr, exitstatus) ⇒ DockerResult
276 277 278 279 280 281 282 |
# File 'lib/chef/provisioning/docker_driver/docker_transport.rb', line 276 def initialize(command, , stdout, stderr, exitstatus) @command = command = @stdout = stdout @stderr = stderr @exitstatus = exitstatus end |
Instance Attribute Details
#command ⇒ Object (readonly)
Returns the value of attribute command.
284 285 286 |
# File 'lib/chef/provisioning/docker_driver/docker_transport.rb', line 284 def command @command end |
#exitstatus ⇒ Object (readonly)
Returns the value of attribute exitstatus.
288 289 290 |
# File 'lib/chef/provisioning/docker_driver/docker_transport.rb', line 288 def exitstatus @exitstatus end |
#options ⇒ Object (readonly)
Returns the value of attribute options.
285 286 287 |
# File 'lib/chef/provisioning/docker_driver/docker_transport.rb', line 285 def end |
#stderr ⇒ Object (readonly)
Returns the value of attribute stderr.
287 288 289 |
# File 'lib/chef/provisioning/docker_driver/docker_transport.rb', line 287 def stderr @stderr end |
#stdout ⇒ Object (readonly)
Returns the value of attribute stdout.
286 287 288 |
# File 'lib/chef/provisioning/docker_driver/docker_transport.rb', line 286 def stdout @stdout end |
Instance Method Details
#error! ⇒ Object
290 291 292 293 294 295 296 297 |
# File 'lib/chef/provisioning/docker_driver/docker_transport.rb', line 290 def error! if exitstatus != 0 msg = "Error: command '#{command}' exited with code #{exitstatus}.\n" msg << "STDOUT: #{stdout}" if ![:stream] && ![:stream_stdout] && Chef::Config.log_level != :debug msg << "STDERR: #{stderr}" if ![:stream] && ![:stream_stderr] && Chef::Config.log_level != :debug raise msg end end |