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
Returns a new instance of DockerResult.
221 222 223 224 225 226 227 |
# File 'lib/chef/provisioning/docker_driver/docker_transport.rb', line 221 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.
229 230 231 |
# File 'lib/chef/provisioning/docker_driver/docker_transport.rb', line 229 def command @command end |
#exitstatus ⇒ Object (readonly)
Returns the value of attribute exitstatus.
233 234 235 |
# File 'lib/chef/provisioning/docker_driver/docker_transport.rb', line 233 def exitstatus @exitstatus end |
#options ⇒ Object (readonly)
Returns the value of attribute options.
230 231 232 |
# File 'lib/chef/provisioning/docker_driver/docker_transport.rb', line 230 def @options end |
#stderr ⇒ Object (readonly)
Returns the value of attribute stderr.
232 233 234 |
# File 'lib/chef/provisioning/docker_driver/docker_transport.rb', line 232 def stderr @stderr end |
#stdout ⇒ Object (readonly)
Returns the value of attribute stdout.
231 232 233 |
# File 'lib/chef/provisioning/docker_driver/docker_transport.rb', line 231 def stdout @stdout end |
Instance Method Details
#error! ⇒ Object
235 236 237 238 239 240 241 242 |
# File 'lib/chef/provisioning/docker_driver/docker_transport.rb', line 235 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 |