break
if wait_count == 0:
- LOG.error("ceph-mon was not able to join quorum within 10 minutes")
+ raise SystemExit("ceph-mon was not able to join quorum within 10 minutes")
def get_key(cluster, mon_id):
if not os.path.exists(pathdir):
os.makedirs(pathdir)
- while True:
+ wait_count = 600 # 10 minutes
+ while wait_count > 0:
try:
with file(tmp, 'w') as f:
os.fchmod(f.fileno(), 0600)
else:
LOG.info('Cannot get or create bootstrap key for %s', type_)
time.sleep(1)
+ wait_count -= 1
continue
os.rename(tmp, path)
pass
else:
raise
+ if wait_count == 0:
+ raise SystemExit("Could not get or create %s bootstrap key after 10 minutes" % type_)
def parse_args():