Skip to content

Commit f466e44

Browse files
author
Johan De Wit
committed
add debug statements
1 parent 23739c6 commit f466e44

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

lib/puppet/provider/mongodb.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,7 @@ def db_ismaster
149149

150150
def self.auth_enabled(config = nil)
151151
config ||= mongo_conf
152+
Puppet.debug("in self.auth_enabled with config #{config}")
152153
config['auth'] && config['auth'] != 'disabled'
153154
end
154155

lib/puppet/provider/mongodb_replset/mongo.rb

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ def db_ismaster(host)
7373
end
7474

7575
def rs_initiate(conf, master)
76+
Puppet.debug("in rs_initiate with conf is #{conf} and master is #{master} and auth_enabled is #{auth_enabled}")
7677
if auth_enabled && auth_enabled != 'disabled'
7778
mongo_command("rs.initiate(#{conf})", initialize_host)
7879
else
@@ -81,10 +82,12 @@ def rs_initiate(conf, master)
8182
end
8283

8384
def rs_status(host)
85+
Puppet.debug("in rs_status with host is #{host}")
8486
mongo_command('rs.status()', host)
8587
end
8688

8789
def rs_config(host)
90+
Puppet.debug("in rs_config with host is #{host}")
8891
mongo_command('rs.config()', host)
8992
end
9093

@@ -114,6 +117,7 @@ def rs_add_arbiter(host, master)
114117
end
115118

116119
def auth_enabled
120+
Puppet.debug('in auth_enabled')
117121
self.class.auth_enabled
118122
end
119123

@@ -122,6 +126,7 @@ def initialize_host
122126
end
123127

124128
def master_host(members)
129+
Puppet.debug("in master_host with memebers is #{members}")
125130
members.each do |member|
126131
status = db_ismaster(member['host'])
127132
return status['primary'] if status.key?('primary')

0 commit comments

Comments
 (0)