Skip to content

Commit bae3cd1

Browse files
author
Johan De Wit
committed
[cleanup] cleanup unused code and debug lines
1 parent 1499d2a commit bae3cd1

File tree

2 files changed

+4
-13
lines changed

2 files changed

+4
-13
lines changed

lib/puppet/provider/mongodb_replset/mongo.rb

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -389,17 +389,10 @@ def mongo_command(command, host, retries = 4)
389389
end
390390

391391
def self.mongo_command(command, host = nil, retries = 4)
392-
#begin
393-
output = mongo_eval("EJSON.stringify(#{command})", 'admin', retries, host)
394-
#rescue Puppet::ExecutionFailure => e
395-
#if e.message =~ %r{no replset config has been received} || e.message =~ %r{Authentication failed}
396-
if output =~ %r{no replset config has been received} || output =~ %r{Authentication failed}
397-
output = '{}'
398-
# else
399-
# Puppet.debug "Got an exception: #{e}"
400-
# raise
401-
end
402-
#end
392+
output = mongo_eval("EJSON.stringify(#{command})", 'admin', retries, host)
393+
if output =~ %r{no replset config has been received} || output =~ %r{Authentication failed}
394+
output = '{}'
395+
end
403396

404397
# Hack to avoid non-json empty sets
405398
output = '{}' if output =~ %r{no replset config} || output =~ %r{Authentication failed}

lib/puppet/provider/mongodb_user/mongodb.rb

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,6 @@ def self.instances
1919

2020
users = JSON.parse out
2121

22-
Puppet.debug("XXXXXXXX In self.instances, retrieved users: #{users}")
23-
2422
users.map do |user|
2523
db = if user['db'] == '$external'
2624
# For external users, we need to retreive the original DB name from here.

0 commit comments

Comments
 (0)