Author: arkurth
Date: Tue Sep 21 19:27:28 2010
New Revision: 999560

URL: http://svn.apache.org/viewvc?rev=999560&view=rev
Log:
VCL-298
Updated VMware.pm to call set_vcld_post_load_status() after executing the OS 
module's post_load subroutine to prevent the post_load tasks from being 
executed multiple times.

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

Modified: 
incubator/vcl/trunk/managementnode/lib/VCL/Module/Provisioning/VMware/VMware.pm
URL: 
http://svn.apache.org/viewvc/incubator/vcl/trunk/managementnode/lib/VCL/Module/Provisioning/VMware/VMware.pm?rev=999560&r1=999559&r2=999560&view=diff
==============================================================================
--- 
incubator/vcl/trunk/managementnode/lib/VCL/Module/Provisioning/VMware/VMware.pm 
(original)
+++ 
incubator/vcl/trunk/managementnode/lib/VCL/Module/Provisioning/VMware/VMware.pm 
Tue Sep 21 19:27:28 2010
@@ -358,11 +358,19 @@ sub load {
        insertloadlog($reservation_id, $computer_id, "startvm", "registered and 
powered on $computer_name");
        
        # Call the OS module's post_load() subroutine if implemented
-       if ($self->os->can("post_load") && !$self->os->post_load()) {
-               notify($ERRORS{'WARNING'}, 0, "failed to perform OS post-load 
tasks on VM $computer_name on VM host: $vmhost_hostname");
-               return;
+       if ($self->os->can("post_load")) {
+               if ($self->os->post_load()) {
+                       $self->os->set_vcld_post_load_status();
+                       insertloadlog($reservation_id, $computer_id, 
"loadimagecomplete", "performed OS post-load tasks on $computer_name");
+               }
+               else {
+                       notify($ERRORS{'WARNING'}, 0, "failed to perform OS 
post-load tasks on VM $computer_name on VM host: $vmhost_hostname");
+                       return;
+               }
+       }
+       else {
+               insertloadlog($reservation_id, $computer_id, 
"loadimagecomplete", "OS post-load tasks not necessary on $computer_name");
        }
-       insertloadlog($reservation_id, $computer_id, "loadimagecomplete", 
"performed OS post-load tasks on $computer_name");
        
        return 1;
 }


Reply via email to