From d7e93945b3e6541b262dd2dc68bffb8c66471da8 Mon Sep 17 00:00:00 2001 From: jbjohnso Date: Thu, 12 Nov 2009 22:06:04 +0000 Subject: [PATCH] -Attempt to pre-load VMWare SDK ahead of time to speed up loading git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@4560 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- xCAT-server/lib/xcat/plugins/esx.pm | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/xCAT-server/lib/xcat/plugins/esx.pm b/xCAT-server/lib/xcat/plugins/esx.pm index ac691da61..db2f38560 100644 --- a/xCAT-server/lib/xcat/plugins/esx.pm +++ b/xCAT-server/lib/xcat/plugins/esx.pm @@ -38,6 +38,11 @@ my $executerequest; my %tablecfg; #to hold the tables my $currkey; my $viavcenter; +my $vmwaresdkdetect = eval { + require VMware::VIRuntime; + VMware::VIRuntime->import(); + 1; +}; my %guestidmap = ( @@ -218,11 +223,13 @@ sub process_request { } #From here on out, code for managing guests under VMware #Detect whether or not the VMware SDK is available on this specific system - my $vmwaresdkdetect = eval { - require VMware::VIRuntime; - VMware::VIRuntime->import(); - 1; - }; + unless ($vmwaresdkdetect) { + $vmwaresdkdetect = eval { + require VMware::VIRuntime; + VMware::VIRuntime->import(); + 1; + }; + } unless ($vmwaresdkdetect) { sendmsg([1,"VMWare SDK required for operation, but not installed"]); return;