Skip to content

Commit

Permalink
[cleanup] cleanup unused code and debug lines
Browse files Browse the repository at this point in the history
  • Loading branch information
Johan De Wit committed Jan 20, 2024
1 parent cb3f178 commit e67ae30
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 13 deletions.
15 changes: 4 additions & 11 deletions lib/puppet/provider/mongodb_replset/mongo.rb
Original file line number Diff line number Diff line change
Expand Up @@ -389,17 +389,10 @@ def mongo_command(command, host, retries = 4)
end

def self.mongo_command(command, host = nil, retries = 4)
#begin
output = mongo_eval("EJSON.stringify(#{command})", 'admin', retries, host)
#rescue Puppet::ExecutionFailure => e
#if e.message =~ %r{no replset config has been received} || e.message =~ %r{Authentication failed}
if output =~ %r{no replset config has been received} || output =~ %r{Authentication failed}
output = '{}'
# else
# Puppet.debug "Got an exception: #{e}"
# raise
end
#end
output = mongo_eval("EJSON.stringify(#{command})", 'admin', retries, host)
if output =~ %r{no replset config has been received} || output =~ %r{Authentication failed}
output = '{}'
end

# Hack to avoid non-json empty sets
output = '{}' if output =~ %r{no replset config} || output =~ %r{Authentication failed}
Expand Down
2 changes: 0 additions & 2 deletions lib/puppet/provider/mongodb_user/mongodb.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@ def self.instances

users = JSON.parse out

Puppet.debug("XXXXXXXX In self.instances, retrieved users: #{users}")

users.map do |user|
db = if user['db'] == '$external'
# For external users, we need to retreive the original DB name from here.
Expand Down

0 comments on commit e67ae30

Please sign in to comment.