This commit is contained in:
garnier-quentin 2020-07-02 10:41:03 +02:00
parent 547cf2115f
commit f0e668fb10
1 changed files with 13 additions and 12 deletions

View File

@ -350,22 +350,23 @@ sub manage_selection {
}
if (defined($self->{option_results}->{filter_duplicate})) {
my $sid = $_;
my @duplicate = grep {
($self->{storage}->{$_}->{allocation_units} == $result->{$oid_hrStorageAllocationUnits . "." . $sid}) &&
($self->{storage}->{$_}->{size} == $result->{$oid_hrStorageSize . "." . $sid}) &&
($self->{storage}->{$_}->{used} == $result->{$oid_hrStorageUsed . "." . $sid})
} keys $self->{storage};
if (scalar(@duplicate)) {
next;
}
my $duplicate = 0;
foreach my $entry (values %{$self->{storage}}) {
if (($entry->{allocation_units} == $result->{$oid_hrStorageAllocationUnits . '.' . $_}) &&
($entry->{size} == $result->{$oid_hrStorageSize . "." . $_}) &&
($entry->{used} == $result->{$oid_hrStorageUsed . "." . $_})) {
$duplicate = 1;
last;
}
}
next if ($duplicate == 1);
}
$self->{storage}->{$_} = {
display => $name_storage,
allocation_units => $result->{$oid_hrStorageAllocationUnits . "." . $_},
size => $result->{$oid_hrStorageSize . "." . $_},
used => $result->{$oid_hrStorageUsed . "." . $_},
allocation_units => $result->{$oid_hrStorageAllocationUnits . '.' . $_},
size => $result->{$oid_hrStorageSize . '.' . $_},
used => $result->{$oid_hrStorageUsed . '.' . $_},
access => defined($access_result->{$_}) ? $access_result->{$_} : undef,
};
$self->{global}->{count}++;