Author: arkurth
Date: Fri May  5 16:46:35 2017
New Revision: 1794075

URL: http://svn.apache.org/viewvc?rev=1794075&view=rev
Log:
Made trivial change to VMware.pm regarding whether or not to fully initialize 
the object if request.state = 'test'. AFAIK, I'm the only one who uses this 
state during development.

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

Modified: vcl/trunk/managementnode/lib/VCL/Module/Provisioning/VMware/VMware.pm
URL: 
http://svn.apache.org/viewvc/vcl/trunk/managementnode/lib/VCL/Module/Provisioning/VMware/VMware.pm?rev=1794075&r1=1794074&r2=1794075&view=diff
==============================================================================
--- vcl/trunk/managementnode/lib/VCL/Module/Provisioning/VMware/VMware.pm 
(original)
+++ vcl/trunk/managementnode/lib/VCL/Module/Provisioning/VMware/VMware.pm Fri 
May  5 16:46:35 2017
@@ -289,11 +289,6 @@ sub initialize {
                return;
        }
        
-       my $force = shift;
-       
-       return 1 if (!$force && $self->data->get_request_state_name() =~ 
/test/i);
-       notify($ERRORS{'DEBUG'}, 0, "initializing " . ref($self) . " object");
-       
        # Get a DataStructure object containing data for the VM host computer
        my $vmhost_data = $self->get_vmhost_datastructure();
        if (!$vmhost_data) {
@@ -310,6 +305,19 @@ sub initialize {
        my $vmprofile_name = $self->data->get_vmhost_profile_name();
        my $vmprofile_password = $self->data->get_vmhost_profile_password(0);
        
+       # Used only for development/testing
+       # If request state is 'test', full initialization is bypassed by 
default to speed things up
+       # Passing '1' as the argument causes full initialization
+       if ($request_state_name eq 'test') {
+               my $argument = shift;
+               unless (defined($argument) && !ref($argument) && $argument eq 
'1') {
+                       notify($ERRORS{'DEBUG'}, 0, "request state is 
'$request_state_name', bypassing full " . ref($self) . " object 
initialization");
+                       return 1;
+               }
+       }
+       
+       notify($ERRORS{'DEBUG'}, 0, "initializing " . ref($self) . " object");
+       
        my $vmware_api;
        
        notify($ERRORS{'DEBUG'}, 0, "VM profile assigned to 
$vmhost_computer_name: $vmprofile_name");


Reply via email to