Fix for error in the verify pipeline for Windows test

Signed-off-by: Vasu1105 <vasundhara.jagdale@chef.io>
This commit is contained in:
Vasu1105 2022-06-07 15:00:58 +05:30
parent 60af225ed3
commit 8ebeca5c64

View file

@ -1,10 +1,11 @@
module Inspec::Resources
class Lines
attr_reader :output
attr_reader :output, :exit_status
def initialize(raw, desc)
def initialize(raw, desc, exit_status)
@output = raw
@desc = desc
@exit_status = exit_status
end
def to_s
@ -40,7 +41,7 @@ module Inspec::Resources
if cmd.exit_status != 0 || out =~ /Unable to connect to any servers/ || out.downcase =~ /^error:.*/
raise Inspec::Exceptions::ResourceFailed, "Cassandra query with errors: #{out}"
else
Lines.new(cmd.stdout.strip, "Cassandra query: #{q}")
Lines.new(cmd.stdout.strip, "Cassandra query: #{q}", cmd.exit_status)
end
end