]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
ceph-volume: fix has_bluestore_label() function
authorGuillaume Abrioux <gabrioux@redhat.com>
Tue, 4 Feb 2020 21:02:26 +0000 (22:02 +0100)
committerJan Fajerski <jfajerski@suse.com>
Fri, 28 Feb 2020 09:39:36 +0000 (10:39 +0100)
When using vg/lv, this function throws an error like following:

```
 stderr: unable to read label for test_group/data-lv2: (2) No such file or directory
 stderr: 2020-02-04T21:03:32.153+0000 7fe091af4200 -1 bluestore(test_group/data-lv2) _read_bdev_label failed to open test_group/data-lv2: (2) No such file or directory
```

using `self.abspath` fixes this error.

Fixes: https://tracker.ceph.com/issues/43970
Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
(cherry picked from commit 148069a20fef79ef8fe510f06879a0de02987eac)

src/ceph-volume/ceph_volume/util/device.py

index a5bc388f157ba0d2d697ff9a06180b7cc3552fd8..3a5f8361da879f4830585667a7cd53bdaf39dcd0 100644 (file)
@@ -316,7 +316,7 @@ class Device(object):
     def has_bluestore_label(self):
         out, err, ret = process.call([
             'ceph-bluestore-tool', 'show-label',
-            '--dev', self.path])
+            '--dev', self.abspath])
         if ret:
             return False
         return True