import time
-log = logging.getLogger(os.path.basename(sys.argv[0]))
+LOG = logging.getLogger(os.path.basename(sys.argv[0]))
QUORUM_STATES = ['leader', 'peon']
out = p.stdout.read()
returncode = p.wait()
if returncode != 0:
- log.info('ceph-mon admin socket not ready yet.')
+ LOG.info('ceph-mon admin socket not ready yet.')
time.sleep(1)
continue
data = json.loads(out)
state = data['state']
if state not in QUORUM_STATES:
- log.info('ceph-mon is not in quorum: %r', state)
+ LOG.info('ceph-mon is not in quorum: %r', state)
time.sleep(1)
continue
cluster=cluster,
)
if os.path.exists(path):
- log.info('Key exists already: %s', path)
+ LOG.info('Key exists already: %s', path)
return
tmp = '{path}.{pid}.tmp'.format(
path=path,
try:
with file(tmp, 'w') as f:
os.fchmod(f.fileno(), 0600)
- log.info('Talking to monitor...')
+ LOG.info('Talking to monitor...')
returncode = subprocess.call(
args=[
'ceph',
stdout=f,
)
if returncode != 0:
- log.info('Cannot get or create admin key')
+ LOG.info('Cannot get or create admin key')
time.sleep(1)
continue
cluster=cluster,
)
if os.path.exists(path):
- log.info('Key exists already: %s', path)
+ LOG.info('Key exists already: %s', path)
return
tmp = '{path}.{pid}.tmp'.format(
path=path,
try:
with file(tmp, 'w') as f:
os.fchmod(f.fileno(), 0600)
- log.info('Talking to monitor...')
+ LOG.info('Talking to monitor...')
returncode = subprocess.call(
args=args,
stdout=f,
)
if returncode != 0:
- log.info('Cannot get or create bootstrap key for %s', type_)
+ LOG.info('Cannot get or create bootstrap key for %s', type_)
time.sleep(1)
continue