File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed
lib/puppet/provider/mongodb_user Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff 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
You can’t perform that action at this time.
0 commit comments