Skip to content

Commit

Permalink
Merge PR ceph#31798 into master
Browse files Browse the repository at this point in the history
* refs/pull/31798/head:
	ceph-daemon: ceph-volume works without an fsid
	ceph-daemon: several commands that can infer fsids still require them
	ceph-daemon: fix fsid inference

Reviewed-by: Michael Fritch <[email protected]>
  • Loading branch information
liewegas committed Nov 22, 2019
2 parents 842b101 + d3f5125 commit 2c7aa77
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions src/ceph-daemon/ceph-daemon
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ def infer_fsid(func):
def _infer_fsid():
if args.fsid:
logger.debug('Using specified fsid: %s' % args.fsid)
return
return func()

fsid_list = []
for i in os.listdir(args.data_dir):
Expand All @@ -246,7 +246,7 @@ def infer_fsid(func):

if not fsid_list:
# TODO: raise?
return
return func()

if len(fsid_list) > 1:
raise RuntimeError('Cannot infer fsid, must specify --fsid')
Expand Down Expand Up @@ -1330,6 +1330,8 @@ def command_shell():
@infer_fsid
def command_enter():
# type: () -> int
if not args.fsid:
raise RuntimeError('must pass --fsid to specify cluster')
(daemon_type, daemon_id) = args.name.split('.', 1)
container_args = [] # type: List[str]
if args.command:
Expand All @@ -1350,7 +1352,8 @@ def command_enter():
@infer_fsid
def command_ceph_volume():
# type: () -> None
make_log_dir(args.fsid)
if args.fsid:
make_log_dir(args.fsid)

mounts = get_container_mounts(args.fsid, 'osd', None)

Expand Down Expand Up @@ -1393,6 +1396,8 @@ def command_ceph_volume():
@infer_fsid
def command_unit():
# type: () -> None
if not args.fsid:
raise RuntimeError('must pass --fsid to specify cluster')
(daemon_type, daemon_id) = args.name.split('.', 1)
unit_name = get_unit_name(args.fsid, daemon_type, daemon_id)
call_throws([
Expand All @@ -1405,6 +1410,8 @@ def command_unit():
@infer_fsid
def command_logs():
# type: () -> None
if not args.fsid:
raise RuntimeError('must pass --fsid to specify cluster')
cmd = [container_path, 'logs']
if args.follow:
cmd.append('-f')
Expand Down

0 comments on commit 2c7aa77

Please sign in to comment.