File tree Expand file tree Collapse file tree
lib/puppet/provider/mongodb_database
spec/unit/puppet/provider/mongodb_database Expand file tree Collapse file tree Original file line number Diff line number Diff line change 66
77 def self . instances
88 require 'json'
9- dbs = JSON . parse mongo_eval ( 'printjson(db.getMongo().getDBs())' )
9+ dbs = JSON . parse mongo_eval ( 'rs.slaveOk(); printjson(db.getMongo().getDBs())' )
1010
1111 dbs [ 'databases' ] . map do |db |
1212 new ( name : db [ 'name' ] ,
Original file line number Diff line number Diff line change 3838 tmp = Tempfile . new ( 'test' )
3939 mongodconffile = tmp . path
4040 allow ( provider . class ) . to receive ( :mongod_conf_file ) . and_return ( mongodconffile )
41- provider . class . stubs ( :mongo_eval ) . with ( 'printjson(db.getMongo().getDBs())' ) . returns ( raw_dbs )
41+ provider . class . stubs ( :mongo_eval ) . with ( 'rs.slaveOk(); printjson(db.getMongo().getDBs())' ) . returns ( raw_dbs )
4242 allow ( provider . class ) . to receive ( :db_ismaster ) . and_return ( true )
4343 end
4444
You can’t perform that action at this time.
0 commit comments