Skip to content

Commit

Permalink
Fix rueckstiess#858: Replica set init announcement is printed after i…
Browse files Browse the repository at this point in the history
…nit is complete
  • Loading branch information
p authored and stennie committed Oct 26, 2022
1 parent 5ba645f commit ba01571
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions mtools/mlaunch/mlaunch.py
Original file line number Diff line number Diff line change
Expand Up @@ -1823,6 +1823,11 @@ def _initiate_replset(self, port, name, maxwait=30):
return rs_status
except OperationFailure:
# not initiated yet

if self.args['verbose']:
print("initializing replica set '%s' with configuration: %s"
% (name, self.config_docs[name]))

for i in range(maxwait):
try:
con['admin'].command({'replSetInitiate':
Expand All @@ -1832,9 +1837,6 @@ def _initiate_replset(self, port, name, maxwait=30):
print('Replica set initialization failed: %s - will retry' % e)
time.sleep(1)

if self.args['verbose']:
print("initializing replica set '%s' with configuration: %s"
% (name, self.config_docs[name]))
print("replica set '%s' initialized." % name)

def _add_user(self, port, name, password, database, roles):
Expand Down

0 comments on commit ba01571

Please sign in to comment.