]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
cephadm: require fsid if name contains a daemon id 32795/head
authorMichael Fritch <mfritch@suse.com>
Thu, 23 Jan 2020 15:12:10 +0000 (08:12 -0700)
committerMichael Fritch <mfritch@suse.com>
Thu, 23 Jan 2020 15:17:19 +0000 (08:17 -0700)
$ cephadm shell --name mon.123
INFO:cephadm:Found fsids []
Traceback (most recent call last):
  File "./cephadm", line 2805, in <module>
    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 <mfritch@suse.com>
src/cephadm/cephadm

index 6067be3e4c262e30a1dbaf260b8b08deca9cbab2..b9d495b8580a9c4f56b748fb9c4feee6ac708337 100755 (executable)
@@ -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: