make xcatd tolerant of syntax errors in plugins, fixed syntax error in conserver.pm

git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@4611 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
This commit is contained in:
mellor 2009-11-18 14:51:19 +00:00
parent 7e3bec91ed
commit beffdd517f
3 changed files with 7 additions and 2 deletions

View File

@ -197,7 +197,7 @@ sub scan_plugins {
foreach (@plugins) {
/.*\/([^\/]*).pm$/;
my $modname = $1;
require "$_";
unless (eval { require "$_" }) { print "Error loading module $_ ...skipping\n"; next;}
no strict 'refs';
my $cmd_adds=${"xCAT_plugin::".$modname."::"}{handled_commands}->();
foreach (keys %$cmd_adds) {

View File

@ -165,6 +165,7 @@ sub preprocess_request {
my $rsp;
$rsp->{data}->[0] = "In preprocess_request, request is " . Dumper(@requests);
xCAT::MsgUtils->message("I", $rsp, $callback);
}
}
return \@requests;
}

View File

@ -433,7 +433,11 @@ sub scan_plugins {
foreach (@plugins) {
/.*\/([^\/]*).pm$/;
my $modname = $1;
require "$_";
unless ( eval { require "$_" }) {
xCAT::MsgUtils->message("S","Error loading module ".$_." ...skipping");
next;
}
no strict 'refs';
my $cmd_adds=${"xCAT_plugin::".$modname."::"}{handled_commands}->();
foreach (keys %$cmd_adds) {