Skip to content

Commit f0562a0

Browse files
author
Johan De Wit
committed
re-enable master check
1 parent 4043289 commit f0562a0

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

Diff for: lib/puppet/provider/mongodb_user/mongodb.rb

+5-5
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ def self.instances
1111

1212
Puppet.debug("MONGODB_USER self.instances")
1313

14-
#if db_ismaster
14+
if db_ismaster
1515
script = 'EJSON.stringify(db.system.users.find().toArray())'
1616
# A hack to prevent prefetching failures until admin user is created
1717
script = "try {#{script}} catch (e) { if (e.message.match(/requires authentication/) || e.message.match(/not authorized on admin/)) { 'not authorized on admin' } else {throw e}}" if auth_enabled
@@ -41,10 +41,10 @@ def self.instances
4141
password_hash: user['credentials']['MONGODB-CR'],
4242
scram_credentials: user['credentials']['SCRAM-SHA-1'])
4343
end
44-
#else
45-
# Puppet.warning 'User info is available only from master host'
46-
# []
47-
#end
44+
else
45+
Puppet.warning 'User info is available only from master host'
46+
[]
47+
end
4848
end
4949

5050
# Assign prefetched users based on username and database, not on id and name

0 commit comments

Comments
 (0)