class Inspec::Resources::MongodbConf

Public Class Methods

new(conf_path = nil) click to toggle source
Calls superclass method Inspec::Resources::JsonConfig::new
# File lib/inspec/resources/mongodb_conf.rb, line 17
def initialize(conf_path = nil)
  @conf_path = conf_path || inspec.mongodb.conf_path

  if @conf_path.nil?
    return skip_resource "MongoDB conf path is not set."
  end

  super(@conf_path)
end

Private Instance Methods

parse(content) click to toggle source
# File lib/inspec/resources/mongodb_conf.rb, line 29
def parse(content)
  YAML.load(content)
rescue => e
  raise Inspec::Exceptions::ResourceFailed, "Unable to parse `mongod.conf` or `mongod.cfg` file: #{e.message}"
end
resource_base_name() click to toggle source
# File lib/inspec/resources/mongodb_conf.rb, line 35
def resource_base_name
  "MongoDB Configuration"
end