Skip to content

Commit 896f5ed

Browse files
author
Benjamin Delacour
committed
fix: replset with auth returns "requires authentication" message when checking replicaset members
1 parent 3ca0348 commit 896f5ed

File tree

1 file changed

+1
-1
lines changed
  • lib/puppet/provider/mongodb_replset

1 file changed

+1
-1
lines changed

lib/puppet/provider/mongodb_replset/mongo.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ def get_hosts_status(members)
157157
raise Puppet::Error, "Can't configure replicaset #{name}, host #{host} is not supposed to be part of a replicaset."
158158
end
159159

160-
if auth_enabled && status.key?('errmsg') && (status['errmsg'].include?('unauthorized') || status['errmsg'].include?('not authorized'))
160+
if auth_enabled && status.key?('errmsg') && (status['errmsg'].include?('unauthorized') || status['errmsg'].include?('not authorized') || status['errmsg'].include?('requires authentication'))
161161
Puppet.warning "Host #{host} is available, but you are unauthorized because of authentication is enabled: #{auth_enabled}"
162162
alive.push(member)
163163
end

0 commit comments

Comments
 (0)