Merge pull request #777 from omercier/typo-finded-variables

+Fix typo variables and functions containing finded
This commit is contained in:
qgarnier 2017-10-12 15:16:02 +02:00 committed by GitHub
commit 7e3fb9343a
1 changed files with 7 additions and 7 deletions

View File

@ -98,20 +98,20 @@ sub run {
short_msg => "'$config': cannot parse xml"); short_msg => "'$config': cannot parse xml");
next; next;
} }
my %failover_finded = (); my %failover_found = ();
my %file_finded = (); my %file_found = ();
my $temporary; my $temporary;
foreach my $node ($xml->findnodes('/centreonBroker/output')) { foreach my $node ($xml->findnodes('/centreonBroker/output')) {
my %load = (); my %load = ();
foreach my $element ($node->getChildrenByTagName('*')) { foreach my $element ($node->getChildrenByTagName('*')) {
if ($element->nodeName eq 'failover') { if ($element->nodeName eq 'failover') {
$failover_finded{$element->textContent} = 1; $failover_found{$element->textContent} = 1;
} elsif ($element->nodeName =~ /^(name|type|path)$/) { } elsif ($element->nodeName =~ /^(name|type|path)$/) {
$load{$element->nodeName} = $element->textContent; $load{$element->nodeName} = $element->textContent;
} }
} }
if (defined($load{type}) && $load{type} eq 'file') { if (defined($load{type}) && $load{type} eq 'file') {
$file_finded{$load{name}} = {%load}; $file_found{$load{name}} = {%load};
} }
} }
@ -123,10 +123,10 @@ sub run {
# Check failovers # Check failovers
my $current_total = 0; my $current_total = 0;
foreach my $failover (sort keys %failover_finded) { foreach my $failover (sort keys %failover_found) {
next if (!defined($file_finded{$failover})); next if (!defined($file_found{$failover}));
my ($status, $total, $size) = $self->check_directory(config => $config, path => $file_finded{$failover}->{path}); my ($status, $total, $size) = $self->check_directory(config => $config, path => $file_found{$failover}->{path});
next if (!$status); next if (!$status);
$current_total += $total; $current_total += $total;