You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Puppet.debug"Checking replicaset member #{host} ..."
171
-
status=rs_status(host)
172
-
raisePuppet::Error,"Can't configure replicaset #{name}, host #{host} is not supposed to be part of a replicaset."ifstatus.key?('errmsg') && status['errmsg'] == 'not running with --replSet'
Puppet.debug("Node #{host} is reachable but requires authentication: RS not initialized")
198
-
alive.push(member)
199
-
else
200
-
Puppet.warning"Can't connect to replicaset member #{host} (Errormsg: #{e.message})."
174
+
begin
175
+
status=rs_status(host)
176
+
Puppet.debug('XXXXXXXXXXXXXX should not get here since I dont have a replicaset')
177
+
raisePuppet::Error,"Can't configure replicaset #{name}, host #{host} is not supposed to be part of a replicaset."ifstatus.key?('errmsg') && status['errmsg'] == 'not running with --replSet'
178
+
179
+
# if auth_enabled && status.key?('errmsg')
180
+
# Puppet.debug "In auth_enabled && status.key?('errmsg')"
181
+
# if status['errmsg'].include?('requires authentication') || status['errmsg'].include?('not authorized on admin') || status['errmsg'].include?('Authentication failed')
182
+
# Puppet.debug "In auth_enabled && status.key?('errmsg') need authentication"
183
+
# Puppet.warning "Host #{host} is available, but you are unauthorized because of authentication is enabled: #{auth_enabled}"
184
+
# alive.push(member)
185
+
# elsif status['errmsg'].include?('no replset config has been received')
186
+
# Puppet.debug 'Mongo rs.status() RS not initialized output'
187
+
# alive.push(member)
188
+
# end
189
+
# end
190
+
191
+
ifstatus.key?('set')
192
+
raisePuppet::Error,"Can't configure replicaset #{name}, host #{host} is already part of another replicaset."ifstatus['set'] != name
193
+
194
+
# This node is alive and supposed to be a member of our set
195
+
Puppet.debug"Host #{host} is available for replset #{status['set']}"
196
+
alive.push(member)
197
+
elsifstatus.key?('info')
198
+
Puppet.debug"Host #{host} is alive but unconfigured: #{status['info']}"
199
+
alive.push(member)
200
+
end
201
+
rescuePuppet::ExecutionFailure=>e
202
+
Puppet.debug('XXXXXXXXXXXX in rescue checking connection mebers')
0 commit comments