From 457c75dfdaf3239141719a83709cd024eb7af685 Mon Sep 17 00:00:00 2001 From: Michael Fritch Date: Thu, 23 Jan 2020 08:12:10 -0700 Subject: [PATCH] cephadm: require fsid if name contains a daemon id $ cephadm shell --name mon.123 INFO:cephadm:Found fsids [] Traceback (most recent call last): File "./cephadm", line 2805, in r = args.func() File "./cephadm", line 646, in _infer_fsid return func() File "./cephadm", line 1992, in command_shell no_config=True if args.config else False) File "./cephadm", line 1009, in get_container_mounts data_dir = get_data_dir(fsid, daemon_type, daemon_id) File "./cephadm", line 670, in get_data_dir return os.path.join(args.data_dir, fsid, '%s.%s' % (t, n)) File "/usr/lib64/python3.7/posixpath.py", line 94, in join genericpath._check_arg_types('join', a, *p) File "/usr/lib64/python3.7/genericpath.py", line 149, in _check_arg_types (funcname, s.__class__.__name__)) from None TypeError: join() argument must be str or bytes, not 'NoneType' Signed-off-by: Michael Fritch --- src/cephadm/cephadm | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/cephadm/cephadm b/src/cephadm/cephadm index 6067be3e4c2..b9d495b8580 100755 --- a/src/cephadm/cephadm +++ b/src/cephadm/cephadm @@ -1988,6 +1988,10 @@ def command_shell(): else: daemon_type = 'osd' # get the most mounts daemon_id = None + + if daemon_id and not args.fsid: + raise Error('must pass --fsid to specify cluster') + mounts = get_container_mounts(args.fsid, daemon_type, daemon_id, no_config=True if args.config else False) if args.config: -- 2.47.3