vcl-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From arku...@apache.org
Subject svn commit: r1058318 - /incubator/vcl/trunk/managementnode/lib/VCL/Module/Provisioning/VMware/vSphere_SDK.pm
Date Wed, 12 Jan 2011 21:06:39 GMT
Author: arkurth
Date: Wed Jan 12 21:06:38 2011
New Revision: 1058318

URL: http://svn.apache.org/viewvc?rev=1058318&view=rev
Log:
VCL-394
Updated vSphere_SDK.pm to catch the fatal error that occurs if the vSphere SDK isn't installed
on the management node.  In initialize(), the die handler is locally overridden and a useful
message is displayed if the vSphere SDK isn't installed.

Modified:
    incubator/vcl/trunk/managementnode/lib/VCL/Module/Provisioning/VMware/vSphere_SDK.pm

Modified: incubator/vcl/trunk/managementnode/lib/VCL/Module/Provisioning/VMware/vSphere_SDK.pm
URL: http://svn.apache.org/viewvc/incubator/vcl/trunk/managementnode/lib/VCL/Module/Provisioning/VMware/vSphere_SDK.pm?rev=1058318&r1=1058317&r2=1058318&view=diff
==============================================================================
--- incubator/vcl/trunk/managementnode/lib/VCL/Module/Provisioning/VMware/vSphere_SDK.pm (original)
+++ incubator/vcl/trunk/managementnode/lib/VCL/Module/Provisioning/VMware/vSphere_SDK.pm Wed
Jan 12 21:06:38 2011
@@ -61,10 +61,6 @@ use List::Util qw( max );
 
 use VCL::utils;
 
-use VMware::VIRuntime;
-use VMware::VILib;
-use VMware::VIExt;
-
 ##############################################################################
 
 =head1 API OBJECT METHODS
@@ -1805,6 +1801,16 @@ sub initialize {
 		return;
 	}
 	
+	# Override the die handler because process will die if VMware Perl libraries aren't installed
+	local $SIG{__DIE__} = sub{};
+	
+	eval "use VMware::VIRuntime; use VMware::VILib; use VMware::VIExt";
+	if ($EVAL_ERROR) {
+		notify($ERRORS{'OK'}, 0, "vSphere SDK for Perl does not appear to be installed on this
managment node, unable to load VMware vSphere SDK Perl modules");
+		return 0;
+	}
+	notify($ERRORS{'DEBUG'}, 0, "loaded VMware vSphere SDK modules");
+	
 	my $vmhost_hostname = $self->data->get_vmhost_hostname();
 	my $vmhost_username = $self->data->get_vmhost_profile_username();
 	my $vmhost_password = $self->data->get_vmhost_profile_password();



Mime
View raw message