From 2949acd638dc59d0f7e8373c79fb1f17bff4a97a Mon Sep 17 00:00:00 2001 From: Wolfgang Bumiller Date: Wed, 15 Jun 2022 10:42:20 +0200 Subject: [PATCH] diskmanage: only set mounted property for mounted devices instead of setting an empty string for not mounted devices Signed-off-by: Wolfgang Bumiller --- PVE/Diskmanage.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/PVE/Diskmanage.pm b/PVE/Diskmanage.pm index 253916b..8ed7a8b 100644 --- a/PVE/Diskmanage.pm +++ b/PVE/Diskmanage.pm @@ -605,7 +605,6 @@ sub get_disks { size => $sysdata->{size}, serial => $data->{serial}, gpt => $data->{gpt}, - mounted => exists $mounted->{$devpath}, rpm => $data->{rpm}, type => $type, wwn => $data->{wwn}, @@ -613,6 +612,7 @@ sub get_disks { devpath => $devpath, wearout => $wearout, }; + $disklist->{$dev}->{mounted} = 1 if exists $mounted->{$devpath}; my $by_id_link = $data->{by_id_link}; $disklist->{$dev}->{by_id_link} = $by_id_link if defined($by_id_link); @@ -691,7 +691,7 @@ sub get_disks { $partitions->{$part}->{devpath} = "$partpath/$part"; $partitions->{$part}->{parent} = "$devpath"; - $partitions->{$part}->{mounted} = exists $mounted->{"$partpath/$part"}; + $partitions->{$part}->{mounted} = 1 if exists $mounted->{"$partpath/$part"}; $partitions->{$part}->{gpt} = $data->{gpt}; $partitions->{$part}->{type} = 'partition'; $partitions->{$part}->{size} =