]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
cephadm: Aquire lock, if fsid != None 34674/head
authorSebastian Wagner <sebastian.wagner@suse.com>
Wed, 22 Apr 2020 09:51:49 +0000 (11:51 +0200)
committerSebastian Wagner <sebastian.wagner@suse.com>
Wed, 22 Apr 2020 09:51:49 +0000 (11:51 +0200)
Fixes:

```
Traceback (most recent call last):
  File "./cephadm", line 4494, in <module>
    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 <sebastian.wagner@suse.com>
src/cephadm/cephadm

index 6031e2535e88b7d2963a4062c11774b8d45104e7..5415e1df86b8086a6fae48ab132214abefd1b3e4 100755 (executable)
@@ -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)