diskmanage: don't set usage for unused partitions
The disk type is already 'partition' so there's no additional information here. And it would need to serve as a code-word for unused partitions. The cleaner approach is to not set the usage. Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
This commit is contained in:
committed by
Thomas Lamprecht
parent
bd46e59b5d
commit
ff91cfae35
@ -661,7 +661,7 @@ sub get_disks {
|
|||||||
# for devices, this check is done explicitly later
|
# for devices, this check is done explicitly later
|
||||||
return 'Device Mapper' if !dir_is_empty("$sysdir/holders");
|
return 'Device Mapper' if !dir_is_empty("$sysdir/holders");
|
||||||
|
|
||||||
return 'partition';
|
return; # unused partition
|
||||||
};
|
};
|
||||||
|
|
||||||
my $collect_ceph_info = sub {
|
my $collect_ceph_info = sub {
|
||||||
@ -730,7 +730,6 @@ sub get_disks {
|
|||||||
my $used = $determine_usage->($devpath, $sysdir, 0);
|
my $used = $determine_usage->($devpath, $sysdir, 0);
|
||||||
if (!$include_partitions) {
|
if (!$include_partitions) {
|
||||||
foreach my $part (sort keys %{$partitions}) {
|
foreach my $part (sort keys %{$partitions}) {
|
||||||
next if $partitions->{$part}->{used} eq 'partition';
|
|
||||||
$used //= $partitions->{$part}->{used};
|
$used //= $partitions->{$part}->{used};
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Reference in New Issue
Block a user