-
-
Notifications
You must be signed in to change notification settings - Fork 444
catch errors based on missing authentication to allow creation of admin user on replicaset setup #479
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
catch errors based on missing authentication to allow creation of admin user on replicaset setup #479
Changes from 2 commits
3355a7d
a0dd29f
6ae5051
3fcdfde
c3d7b15
4e897bc
e4d9b68
d8af457
6924c35
38a83c4
3d08ff2
f752b12
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -6,19 +6,23 @@ | |
|
|
||
| def self.instances | ||
| require 'json' | ||
| dbs = JSON.parse mongo_eval('printjson(db.getMongo().getDBs())') | ||
| begin | ||
|
||
| dbs = JSON.parse mongo_eval('printjson(db.getMongo().getDBs())') | ||
|
|
||
| dbs['databases'].map do |db| | ||
| new(name: db['name'], | ||
| ensure: :present) | ||
| dbs['databases'].map do |db| | ||
| new(name: db['name'], | ||
| ensure: :present) | ||
| end | ||
| rescue | ||
|
||
| {} | ||
|
||
| end | ||
| end | ||
|
|
||
| # Assign prefetched dbs based on name. | ||
| def self.prefetch(resources) | ||
| dbs = instances | ||
| resources.keys.each do |name| | ||
| provider = dbs.find { |db| db.name == name } | ||
| provider = dbs.find {|db| db.name == name} | ||
| resources[name].provider = provider if provider | ||
| end | ||
| end | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps you should switch these around because
reswill not be defined ifmongorc_fileis false.