]> git.proxmox.com Git - pve-storage.git/commitdiff
(finally) fix #1099: return disklist correctly
authorDominik Csapak <d.csapak@proxmox.com>
Wed, 8 Nov 2017 08:01:58 +0000 (09:01 +0100)
committerFabian Grünbichler <f.gruenbichler@proxmox.com>
Tue, 14 Nov 2017 12:23:52 +0000 (13:23 +0100)
in get_disks, when called with a parameter 'cciss/cXdY', we replaced
the '/' with '!' so that we can properly poll the information
about it from /sys/block/

but we have to replace the '!' with '/' again in our result list,
because the caller does not know anything about it and fails, because
the original dev is not in the list

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
PVE/Diskmanage.pm
test/disk_tests/cciss/disklist_expected.json

index e1db2ae67c803af87a031d92bb64810f8000706c..23e5b13ecce0a1d1bd2104ebf26973f0f9822288 100644 (file)
@@ -456,6 +456,14 @@ sub get_disks {
 
        $used = 'ZFS' if $zfslist->{$devpath};
 
+       # we replaced cciss/ with cciss! above
+       # but in the result we need cciss/ again
+       # because the caller might want to check the
+       # result again with the original parameter
+       if ($dev =~ m|^cciss!|) {
+           $dev =~ s|^cciss!|cciss/|;
+       }
+
        $disklist->{$dev} = {
            vendor => $sysdata->{vendor},
            model => $data->{model} || $sysdata->{model},
index 61f60bfb75efe82c9c1276dcd69ffcb407307978..eff58db5f01d6d28c031dcd55e173a6e4476b3f4 100644 (file)
@@ -1,5 +1,5 @@
 {
-    "cciss!c0d0" : {
+    "cciss/c0d0" : {
        "wearout" : "N/A",
        "vendor" : "HP",
        "rpm" : -1,