Author: arkurth Date: Thu Sep 30 16:00:42 2010 New Revision: 1003121 URL: http://svn.apache.org/viewvc?rev=1003121&view=rev Log: VCL-165 Added check to make sure SSH command that lists the datastore contents was successful in vmware.pm::load(). Without this check, the process dies immediately if the SSH command fails with a 'Can't use an undefined value as an ARRAY reference at...' message when the command's output is parsed later on.
Modified: incubator/vcl/trunk/managementnode/lib/VCL/Module/Provisioning/vmware.pm Modified: incubator/vcl/trunk/managementnode/lib/VCL/Module/Provisioning/vmware.pm URL: http://svn.apache.org/viewvc/incubator/vcl/trunk/managementnode/lib/VCL/Module/Provisioning/vmware.pm?rev=1003121&r1=1003120&r2=1003121&view=diff ============================================================================== --- incubator/vcl/trunk/managementnode/lib/VCL/Module/Provisioning/vmware.pm (original) +++ incubator/vcl/trunk/managementnode/lib/VCL/Module/Provisioning/vmware.pm Thu Sep 30 16:00:42 2010 @@ -257,6 +257,10 @@ sub load { notify($ERRORS{'OK'}, 0, "listing datestore $datastorepath "); undef @sshcmd; @sshcmd = run_ssh_command($hostnode, $management_node_keys, "ls -1 $datastorepath", "root"); + if (!...@sshcmd) { + notify($ERRORS{'WARNING'}, 0, "failed to run SSH command to list datastore contents on vm host: $hostnode"); + return; + } notify($ERRORS{'OK'}, 0, "data store contents $datastorepath on vm host:\...@{ $sshcmd[1] }"); foreach my $l (@{$sshcmd[1]}) { if ($l =~ /denied|No such/) {