From f3e5e9c17d12cd698be40b4f5b9a90b9972758df Mon Sep 17 00:00:00 2001 From: sjing Date: Tue, 6 Mar 2012 05:07:31 +0000 Subject: [PATCH] dynamically loading plugins before we use it. git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@11754 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- xCAT-server/lib/xcat/plugins/tree.pm | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/xCAT-server/lib/xcat/plugins/tree.pm b/xCAT-server/lib/xcat/plugins/tree.pm index d4096741d..207d862c0 100644 --- a/xCAT-server/lib/xcat/plugins/tree.pm +++ b/xCAT-server/lib/xcat/plugins/tree.pm @@ -259,6 +259,7 @@ sub lstree { foreach my $type (keys %hwnodes) { + eval "require xCAT_plugin::$type"; $hwtrees{$type} = ${"xCAT_plugin::".$type."::"}{genhwtree}->(\@{$hwnodes{$type}}, $callback); } } @@ -307,7 +308,11 @@ sub lstree } } - my $ret = xCAT_plugin::zvm::listTree($callback, \@znodes); + if (scalar @znodes) + { + eval "require xCAT_plugin::zvm"; + my $ret = xCAT_plugin::zvm::listTree($callback, \@znodes); + } ########### end ################