]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
ceph-disk: fix /dev/dm-[0-9] handling list_all_partitions()
authorDanny Al-Gaaf <danny.al-gaaf@bisect.de>
Wed, 20 Mar 2013 11:10:22 +0000 (12:10 +0100)
committerSage Weil <sage@inktank.com>
Fri, 26 Apr 2013 20:40:04 +0000 (13:40 -0700)
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
(cherry picked from commit 3af7a1ac5bf24bf832d7180002281d6b5853e85a)

src/ceph-disk

index 51479e2a04d09fd05f4a4c18de36a6674b738508..ab7a89321f211ee58bb58791655adbaeb10bb059 100755 (executable)
@@ -133,8 +133,12 @@ def list_all_partitions():
             fields = re.split('\s+', line)
             if len(fields) < 5:
                 continue
-            (_, major, minor, blocks, name) = fields
+            name = fields[4]
             name = '/dev/' + name
+            if "dm-" in name:
+                if "/dev/dm" not in ls:
+                    ls["/dev/dm"] = []
+                ls["/dev/dm"].append(name)
             if name[-1].isdigit():
                 base = name
                 while base[-1].isdigit():