Author: arkurth
Date: Mon Apr  2 17:23:05 2012
New Revision: 1308435

URL: http://svn.apache.org/viewvc?rev=1308435&view=rev
Log:
VCL-572
Added call to install_updates in Windows.pm::post_load.

VCL-564
Added timeout argument to Windows.pm::run_script.

Modified:
    incubator/vcl/trunk/managementnode/lib/VCL/Module/OS/Windows.pm

Modified: incubator/vcl/trunk/managementnode/lib/VCL/Module/OS/Windows.pm
URL: 
http://svn.apache.org/viewvc/incubator/vcl/trunk/managementnode/lib/VCL/Module/OS/Windows.pm?rev=1308435&r1=1308434&r2=1308435&view=diff
==============================================================================
--- incubator/vcl/trunk/managementnode/lib/VCL/Module/OS/Windows.pm (original)
+++ incubator/vcl/trunk/managementnode/lib/VCL/Module/OS/Windows.pm Mon Apr  2 
17:23:05 2012
@@ -809,6 +809,16 @@ sub post_load {
 
 =item *
 
+ Install Windows updates saved under tools on the management node
+
+=cut
+
+       if (!$self->install_updates()) {
+               notify($ERRORS{'WARNING'}, 0, "failed to run custom post_load 
scripts");
+       }
+
+=item *
+
  Check if the imagemeta postoption is set to reboot, reboot if necessary
 
 =cut
@@ -10869,7 +10879,7 @@ sub get_cpu_core_count {
 
 =head2 run_script
 
- Parameters  : script path
+ Parameters  : $script_path, $timeout_seconds (optional)
  Returns     : boolean
  Description : Checks if script exists on the computer and attempts to run it.
 
@@ -10889,6 +10899,8 @@ sub run_script {
                return;
        }
        
+       my $timeout_seconds = shift || 300;
+       
        my $computer_node_name = $self->data->get_computer_node_name();
        
        # Check if script exists
@@ -10922,8 +10934,8 @@ sub run_script {
        my $command = "cmd.exe /c \"$script_path_escaped & exit %ERRORLEVEL%\"";
        
        # Execute the command
-       notify($ERRORS{'DEBUG'}, 0, "executing script on 
$computer_node_name:\nscript path: $script_path\nlog file path: 
$log_file_path");
-       my ($exit_status, $output) = $self->execute($command);
+       notify($ERRORS{'DEBUG'}, 0, "executing script on 
$computer_node_name:\nscript path: $script_path\nlog file path: 
$log_file_path\nscript timeout: $timeout_seconds seconds");
+       my ($exit_status, $output) = $self->execute($command, 1, 
$timeout_seconds);
        if (!defined($output)) {
                notify($ERRORS{'WARNING'}, 0, "failed to execute script on 
$computer_node_name: '$script_path', command: '$command'");
                return;


Reply via email to