break
if wait_count == 0:
- LOG.error("ceph-mon was not able to join quorum within ten minutes")
+ LOG.error("ceph-mon was not able to join quorum within 10 minutes")
def get_key(cluster, mon_id):
pathdir = os.path.dirname(path)
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 admin key')
time.sleep(1)
+ wait_count -= 1
continue
os.rename(tmp, path)
else:
raise
+ if wait_count == 0:
+ raise SystemExit("Could not get or create the admin key after 10 minutes")
+
+
def bootstrap_key(cluster, type_):
path = '/var/lib/ceph/bootstrap-{type}/{cluster}.keyring'.format(
type=type_,