Class: ChefMetalDocker::DockerTransport::DockerResult
- Inherits:
-
Object
- Object
- ChefMetalDocker::DockerTransport::DockerResult
- Defined in:
- lib/chef_metal_docker/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.
254 255 256 257 258 259 260 |
# File 'lib/chef_metal_docker/docker_transport.rb', line 254 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.
262 263 264 |
# File 'lib/chef_metal_docker/docker_transport.rb', line 262 def command @command end |
#exitstatus ⇒ Object (readonly)
Returns the value of attribute exitstatus.
266 267 268 |
# File 'lib/chef_metal_docker/docker_transport.rb', line 266 def exitstatus @exitstatus end |
#options ⇒ Object (readonly)
Returns the value of attribute options.
263 264 265 |
# File 'lib/chef_metal_docker/docker_transport.rb', line 263 def @options end |
#stderr ⇒ Object (readonly)
Returns the value of attribute stderr.
265 266 267 |
# File 'lib/chef_metal_docker/docker_transport.rb', line 265 def stderr @stderr end |
#stdout ⇒ Object (readonly)
Returns the value of attribute stdout.
264 265 266 |
# File 'lib/chef_metal_docker/docker_transport.rb', line 264 def stdout @stdout end |
Instance Method Details
#error! ⇒ Object
268 269 270 271 272 273 274 275 |
# File 'lib/chef_metal_docker/docker_transport.rb', line 268 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 |