From 207cffbe4569ab5af18bb4945d99c78d7a41c11a Mon Sep 17 00:00:00 2001 From: Sebastian Wagner Date: Wed, 22 Apr 2020 11:51:49 +0200 Subject: [PATCH] cephadm: Aquire lock, if fsid != None Fixes: ``` Traceback (most recent call last): File "./cephadm", line 4494, in r = args.func() File "./cephadm", line 1077, in _infer_fsid return func() File "./cephadm", line 1103, in _infer_image return func() File "./cephadm", line 2813, in command_ceph_volume l = FileLock(args.fsid) File "./cephadm", line 560, in __init__ self._lock_file = os.path.join(LOCK_DIR, name + '.lock') TypeError: unsupported operand type(s) for +: 'NoneType' and 'str' ``` Signed-off-by: Sebastian Wagner (cherry picked from commit 2107649ffaf3d598a2d33cf94f40df1f91dff3c8) --- src/cephadm/cephadm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/cephadm/cephadm b/src/cephadm/cephadm index f2fa9fee342c9..f1663535d327c 100755 --- a/src/cephadm/cephadm +++ b/src/cephadm/cephadm @@ -2810,8 +2810,8 @@ def command_ceph_volume(): if args.fsid: make_log_dir(args.fsid) - l = FileLock(args.fsid) - l.acquire() + l = FileLock(args.fsid) + l.acquire() (uid, gid) = (0, 0) # ceph-volume runs as root mounts = get_container_mounts(args.fsid, 'osd', None) -- 2.39.5