(finally) fix #1099: return disklist correctly
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>
This commit is contained in:
committed by
Fabian Grünbichler
parent
caf67736d9
commit
fc7c0e0504
@ -456,6 +456,14 @@ sub get_disks {
|
|||||||
|
|
||||||
$used = 'ZFS' if $zfslist->{$devpath};
|
$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} = {
|
$disklist->{$dev} = {
|
||||||
vendor => $sysdata->{vendor},
|
vendor => $sysdata->{vendor},
|
||||||
model => $data->{model} || $sysdata->{model},
|
model => $data->{model} || $sysdata->{model},
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
{
|
{
|
||||||
"cciss!c0d0" : {
|
"cciss/c0d0" : {
|
||||||
"wearout" : "N/A",
|
"wearout" : "N/A",
|
||||||
"vendor" : "HP",
|
"vendor" : "HP",
|
||||||
"rpm" : -1,
|
"rpm" : -1,
|
||||||
|
|||||||
Reference in New Issue
Block a user