|
@@ -30,51 +30,54 @@ def fetch_file(args, frompath, topath, _hosts): |
|
|
|
|
|
|
|
|
def gatherkeys(args): |
|
|
# client.admin |
|
|
keyring = '/etc/ceph/{cluster}.client.admin.keyring'.format( |
|
|
cluster=args.cluster) |
|
|
r = fetch_file( |
|
|
args=args, |
|
|
frompath=keyring, |
|
|
topath='{cluster}.client.admin.keyring'.format( |
|
|
cluster=args.cluster), |
|
|
_hosts=args.mon, |
|
|
) |
|
|
if not r: |
|
|
raise exc.KeyNotFoundError(keyring, args.mon) |
|
|
|
|
|
# mon. |
|
|
keyring = '/var/lib/ceph/mon/{cluster}-{{hostname}}/keyring'.format( |
|
|
cluster=args.cluster) |
|
|
r = fetch_file( |
|
|
args=args, |
|
|
frompath=keyring, |
|
|
topath='{cluster}.mon.keyring'.format(cluster=args.cluster), |
|
|
_hosts=args.mon, |
|
|
) |
|
|
if not r: |
|
|
raise exc.KeyNotFoundError(keyring, args.mon) |
|
|
oldmask = os.umask(077) |
|
|
try: |
|
|
# client.admin |
|
|
keyring = '/etc/ceph/{cluster}.client.admin.keyring'.format( |
|
|
cluster=args.cluster) |
|
|
r = fetch_file( |
|
|
args=args, |
|
|
frompath=keyring, |
|
|
topath='{cluster}.client.admin.keyring'.format( |
|
|
cluster=args.cluster), |
|
|
_hosts=args.mon, |
|
|
) |
|
|
if not r: |
|
|
raise exc.KeyNotFoundError(keyring, args.mon) |
|
|
|
|
|
# bootstrap |
|
|
for what in ['osd', 'mds', 'rgw']: |
|
|
keyring = '/var/lib/ceph/bootstrap-{what}/{cluster}.keyring'.format( |
|
|
what=what, |
|
|
# mon. |
|
|
keyring = '/var/lib/ceph/mon/{cluster}-{{hostname}}/keyring'.format( |
|
|
cluster=args.cluster) |
|
|
r = fetch_file( |
|
|
args=args, |
|
|
frompath=keyring, |
|
|
topath='{cluster}.bootstrap-{what}.keyring'.format( |
|
|
cluster=args.cluster, |
|
|
what=what), |
|
|
topath='{cluster}.mon.keyring'.format(cluster=args.cluster), |
|
|
_hosts=args.mon, |
|
|
) |
|
|
if not r: |
|
|
if what in ['osd', 'mds']: |
|
|
raise exc.KeyNotFoundError(keyring, args.mon) |
|
|
else: |
|
|
LOG.warning(("No RGW bootstrap key found. Will not be able to " |
|
|
"deploy RGW daemons")) |
|
|
raise exc.KeyNotFoundError(keyring, args.mon) |
|
|
|
|
|
# bootstrap |
|
|
for what in ['osd', 'mds', 'rgw']: |
|
|
keyring = '/var/lib/ceph/bootstrap-{what}/{cluster}.keyring'.format( |
|
|
what=what, |
|
|
cluster=args.cluster) |
|
|
r = fetch_file( |
|
|
args=args, |
|
|
frompath=keyring, |
|
|
topath='{cluster}.bootstrap-{what}.keyring'.format( |
|
|
cluster=args.cluster, |
|
|
what=what), |
|
|
_hosts=args.mon, |
|
|
) |
|
|
if not r: |
|
|
if what in ['osd', 'mds']: |
|
|
raise exc.KeyNotFoundError(keyring, args.mon) |
|
|
else: |
|
|
LOG.warning(("No RGW bootstrap key found. Will not be able to " |
|
|
"deploy RGW daemons")) |
|
|
finally: |
|
|
os.umask(oldmask) |
|
|
|
|
|
@priority(40) |
|
|
def make(parser): |
|
|
0 comments on commit
eee5677