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

Signed-off-by: Vasu1105 <vasundhara.jagdale@chef.io>
This commit is contained in:
Vasundhara Jagdale 2023-02-03 13:54:08 +05:30 committed by GitHub
parent 444c53e5db
commit b3181ef903
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -84,6 +84,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