diff --git a/lib/puppet/provider/mongodb.rb b/lib/puppet/provider/mongodb.rb index 8973f7026..d73d428b3 100644 --- a/lib/puppet/provider/mongodb.rb +++ b/lib/puppet/provider/mongodb.rb @@ -171,7 +171,7 @@ def self.mongo_eval(cmd, db = 'admin', retries = 10, host = nil) retry_count -= 1 if retry_count.positive? Puppet.debug "Request failed: '#{e.message}' Retry: '#{retries - retry_count}'" - out = { 'errmsg' => "#{e.message}" } + out = { 'errmsg' => e.message } sleep retry_sleep retry end diff --git a/lib/puppet/provider/mongodb_database/mongodb.rb b/lib/puppet/provider/mongodb_database/mongodb.rb index 641078cd7..ad95b7ef6 100644 --- a/lib/puppet/provider/mongodb_database/mongodb.rb +++ b/lib/puppet/provider/mongodb_database/mongodb.rb @@ -9,7 +9,7 @@ def self.instances require 'json' - mongo_eval_result = mongo_eval("JSON.stringify(db.getMongo().getDBs())") + mongo_eval_result = mongo_eval('JSON.stringify(db.getMongo().getDBs())') dbs = JSON.parse mongo_eval_result diff --git a/lib/puppet/provider/mongodb_replset/mongo.rb b/lib/puppet/provider/mongodb_replset/mongo.rb index fe1bd14b3..c7d59d8f7 100644 --- a/lib/puppet/provider/mongodb_replset/mongo.rb +++ b/lib/puppet/provider/mongodb_replset/mongo.rb @@ -396,7 +396,7 @@ def self.mongo_command(command, host = nil, retries = 4) # Parse the JSON output and return begin JSON.parse(output) - rescue + rescue e output end end