From bcddfe6dc99c0ed81b27396406876afe0a4f5767 Mon Sep 17 00:00:00 2001 From: slerena Date: Thu, 20 Aug 2009 15:48:42 +0000 Subject: [PATCH] 2009-08-20 Sancho lerena * lib/PandoraFMS/Tools.pm: Undone commit of 19/8 to fix ugly mesg from enterprise load: was breaking enterprise.... git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1869 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f --- pandora_server/ChangeLog | 5 +++++ pandora_server/lib/PandoraFMS/Tools.pm | 15 ++++++--------- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/pandora_server/ChangeLog b/pandora_server/ChangeLog index 4ce797eeed..794eaad184 100644 --- a/pandora_server/ChangeLog +++ b/pandora_server/ChangeLog @@ -1,3 +1,8 @@ +2009-08-20 Sancho lerena + + * lib/PandoraFMS/Tools.pm: Undone commit of 19/8 to fix ugly mesg from + enterprise load: was breaking enterprise.... + 2009-08-19 Manuel Arostegui * pandora_server.spec: Changed email. diff --git a/pandora_server/lib/PandoraFMS/Tools.pm b/pandora_server/lib/PandoraFMS/Tools.pm index 8dcf80a845..cc73addecc 100644 --- a/pandora_server/lib/PandoraFMS/Tools.pm +++ b/pandora_server/lib/PandoraFMS/Tools.pm @@ -352,15 +352,12 @@ sub enterprise_hook ($$) { # Prepend the package name $func = 'PandoraFMS::Enterprise::' . $func; - # Check if exist before try to call it - my $output = `perl -e "use $func"`; - - if ($output){ - # Try to call the function - $output = eval { &$func (@args); }; - } else { - return $undef; - } + # Try to call the function + my $output = eval { &$func (@args); }; + + # Check for errors + return undef if ($@); + return $output; }