Author: arkurth
Date: Thu Jan 14 20:22:29 2010
New Revision: 899396
URL: http://svn.apache.org/viewvc?rev=899396&view=rev
Log:
VCL-279
Added file existence check in Linux.pm's post_reserve() sub so that it doesn't
attempt to run the script if it doesn't exist.
Modified:
incubator/vcl/trunk/managementnode/lib/VCL/Module/OS/Linux.pm
Modified: incubator/vcl/trunk/managementnode/lib/VCL/Module/OS/Linux.pm
URL:
http://svn.apache.org/viewvc/incubator/vcl/trunk/managementnode/lib/VCL/Module/OS/Linux.pm?rev=899396&r1=899395&r2=899396&view=diff
==============================================================================
--- incubator/vcl/trunk/managementnode/lib/VCL/Module/OS/Linux.pm (original)
+++ incubator/vcl/trunk/managementnode/lib/VCL/Module/OS/Linux.pm Thu Jan 14
20:22:29 2010
@@ -282,11 +282,17 @@
my $image_name = $self->data->get_image_name();
my $computer_short_name = $self->data->get_computer_short_name();
+ my $script_path = '/etc/init.d/vcl_post_reserve';
notify($ERRORS{'OK'}, 0, "initiating Linux post_reserve: $image_name on
$computer_short_name");
+ # Check if script exists
+ if (!$self->filesystem_entry_exists($script_path)) {
+ notify($ERRORS{'DEBUG'}, 0, "script does NOT exist:
$script_path");
+ return 1;
+ }
+
# Run the vcl_post_reserve script if it exists in the image
- my $script_path = '/etc/init.d/vcl_post_reserve';
my $result = $self->run_script($script_path);
if (!defined($result)) {
notify($ERRORS{'WARNING'}, 0, "error occurred running
$script_path");