2011-12-14 Ramon Novoa <rnovoa@artica.es>
* pandora_agent: Do not display a warning if the output of a pre-condition is not numeric. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@5258 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
parent
7f46470d32
commit
a8b8f6cb83
|
@ -1,3 +1,8 @@
|
|||
2011-12-14 Ramon Novoa <rnovoa@artica.es>
|
||||
|
||||
* pandora_agent: Do not display a warning if the output of a
|
||||
pre-condition is not numeric.
|
||||
|
||||
2011-12-07 KIKUCHI Koichiro <koichiro@rworks.jp>
|
||||
|
||||
* pandora_agent_installer: Removed duplicated lines and spaces to
|
||||
|
|
|
@ -1332,7 +1332,6 @@ sub module_freepercentmemory ($) {
|
|||
################################################################################
|
||||
sub evaluate_module_preconditions ($) {
|
||||
my ($module) = @_;
|
||||
my $exe = 1;
|
||||
|
||||
# Evaluate preconditions
|
||||
if ($module->{'precon'}){
|
||||
|
@ -1341,20 +1340,23 @@ sub evaluate_module_preconditions ($) {
|
|||
|
||||
my $data = `$precondition->{'command'} 2> $DevNull`;
|
||||
|
||||
{
|
||||
# Do not display a warning if the output of the command is not numeric
|
||||
no warnings;
|
||||
if (($precondition->{'operator'} eq '>' && $data > $precondition->{'value_1'}) ||
|
||||
($precondition->{'operator'} eq '<' && $data < $precondition->{'value_1'}) ||
|
||||
($precondition->{'operator'} eq '=' && $data == $precondition->{'value_1'}) ||
|
||||
($precondition->{'operator'} eq '!=' && $data != $precondition->{'value_1'}) ||
|
||||
($precondition->{'operator'} eq '=~' && $data =~ /$precondition->{'value_1'}/) ||
|
||||
($precondition->{'operator'} eq '()' && $data > $precondition->{'value_1'} && $data < $precondition->{'value_2'})) {
|
||||
$exe = 1;
|
||||
} else {
|
||||
$exe = 0;
|
||||
return $exe;
|
||||
return 0;
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
return $exe;
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue