CFINSPEC-573: Fix for mongo_session resources prints debug level of information in output of the run result. (#6401) (#6752)

Signed-off-by: Vasu1105 <vasundhara.jagdale@chef.io>
Co-authored-by: Vasundhara Jagdale <vasundhara.jagdale@chef.io>
This commit is contained in:
Nikita Mathur 2023-10-01 20:36:55 +05:30 committed by GitHub
parent 23002cefa4
commit c202742aee
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -80,6 +80,11 @@ module Inspec::Resources
options[:ssl_cert] = @ssl_cert unless @ssl_cert.nil?
options[:ssl_ca_cert] = @ssl_ca_cert unless @ssl_ca_cert.nil?
# Setting the logger level to INFO as mongo gem version 2.13.2 is using DEBUG as the log level Ref: https://github.com/mongodb/mongo-ruby-driver/blob/v2.13.2/lib/mongo/logger.rb#L79
# Latest version of the mongo gem don't have this issue as it set to INFO level Ref: https://github.com/mongodb/mongo-ruby-driver/blob/master/lib/mongo/logger.rb#L82
# We pinned the version to 2.13.2 as the latest version of the mongo gem has broken symlink https://jira.mongodb.org/browse/RUBY-2546 which causes omnibus build failure.
# Once we get the latest version working we can remove logger level set here.
Mongo::Logger.logger.level = Logger::INFO
@client = Mongo::Client.new([ "#{host}:#{port}" ], options)
rescue => e