Author: arkurth
Date: Mon Aug 24 16:24:28 2009
New Revision: 807296

URL: http://svn.apache.org/viewvc?rev=807296&view=rev
Log:
VCL-195
Rearranged and updated Windows modules so that users are logged off as the 
first step of the capture process. Added defrag_hard_drive sub to Version_6.pm 
which only and always returns 1. This step is skipped because it takes a very 
long time with Vista and 2008. Removed unused Data::Dumper import in Windows.pm.

Modified:
    incubator/vcl/trunk/managementnode/lib/VCL/Module/OS/Windows.pm
    incubator/vcl/trunk/managementnode/lib/VCL/Module/OS/Windows/Version_5.pm
    incubator/vcl/trunk/managementnode/lib/VCL/Module/OS/Windows/Version_6.pm
    
incubator/vcl/trunk/managementnode/lib/VCL/Module/OS/Windows/Version_6/2008.pm
    
incubator/vcl/trunk/managementnode/lib/VCL/Module/OS/Windows/Version_6/Vista.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=807296&r1=807295&r2=807296&view=diff
==============================================================================
--- incubator/vcl/trunk/managementnode/lib/VCL/Module/OS/Windows.pm (original)
+++ incubator/vcl/trunk/managementnode/lib/VCL/Module/OS/Windows.pm Mon Aug 24 
16:24:28 2009
@@ -56,13 +56,6 @@
 use VCL::utils;
 use File::Basename;
 
-# Use Data::Dumper to print variables
-use Data::Dumper;
-$Data::Dumper::Indent = 0;
-$Data::Dumper::Terse  = 1;
-$Data::Dumper::Pair   = "=>";
-
-
 ##############################################################################
 
 =head1 CLASS VARIABLES
@@ -294,6 +287,16 @@
 
 =item *
 
+ Defragment hard drive
+
+=cut
+
+       if (!$self->defragment_hard_drive()) {
+               notify($ERRORS{'WARNING'}, 0, "unable to defragment the hard 
drive");
+       }
+
+=item *
+
  Disable the pagefile, reboot, and delete pagefile.sys
  
  ********* node reboots *********

Modified: 
incubator/vcl/trunk/managementnode/lib/VCL/Module/OS/Windows/Version_5.pm
URL: 
http://svn.apache.org/viewvc/incubator/vcl/trunk/managementnode/lib/VCL/Module/OS/Windows/Version_5.pm?rev=807296&r1=807295&r2=807296&view=diff
==============================================================================
--- incubator/vcl/trunk/managementnode/lib/VCL/Module/OS/Windows/Version_5.pm 
(original)
+++ incubator/vcl/trunk/managementnode/lib/VCL/Module/OS/Windows/Version_5.pm 
Mon Aug 24 16:24:28 2009
@@ -80,15 +80,6 @@
                return;
        }
        
-       notify($ERRORS{'OK'}, 0, "beginning Windows version 5 image capture 
preparation tasks");
-       
-       # Defragment the hard drive
-       # Do this in Version_5.pm because defrag works well enough on XP and 
2003
-       # Version 6 OS's (Vista) take a very long time to run defrag
-       if (!$self->defragment_hard_drive()) {
-               notify($ERRORS{'WARNING'}, 0, "unable to defragment the hard 
drive");
-       }
-
        # Call parent class's pre_capture() subroutine
        notify($ERRORS{'OK'}, 0, "calling parent class pre_capture() 
subroutine");
        if ($self->SUPER::pre_capture($args)) {
@@ -99,6 +90,8 @@
                return 0;
        }
        
+       notify($ERRORS{'OK'}, 0, "beginning Windows version 5 image capture 
preparation tasks");
+       
        # Check if Sysprep should be used
        if ($self->data->get_imagemeta_sysprep()) {
                if (!$self->run_sysprep()) {

Modified: 
incubator/vcl/trunk/managementnode/lib/VCL/Module/OS/Windows/Version_6.pm
URL: 
http://svn.apache.org/viewvc/incubator/vcl/trunk/managementnode/lib/VCL/Module/OS/Windows/Version_6.pm?rev=807296&r1=807295&r2=807296&view=diff
==============================================================================
--- incubator/vcl/trunk/managementnode/lib/VCL/Module/OS/Windows/Version_6.pm 
(original)
+++ incubator/vcl/trunk/managementnode/lib/VCL/Module/OS/Windows/Version_6.pm 
Mon Aug 24 16:24:28 2009
@@ -102,10 +102,25 @@
                notify($ERRORS{'CRITICAL'}, 0, "subroutine can only be called 
as a VCL::Module object method");
                return;
        }
+
+=item 1
+
+Call parent class's pre_capture() subroutine
+
+=cut
+
+       notify($ERRORS{'OK'}, 0, "calling parent class pre_capture() 
subroutine");
+       if ($self->SUPER::pre_capture($args)) {
+               notify($ERRORS{'OK'}, 0, "successfully executed parent class 
pre_capture() subroutine");
+       }
+       else {
+               notify($ERRORS{'WARNING'}, 0, "failed to execute parent class 
pre_capture() subroutine");
+               return 0;
+       }
        
        notify($ERRORS{'OK'}, 0, "beginning Windows version 6 image pre-capture 
tasks");
 
-=item 1
+=item *
 
 Disable defrag scheduled task
 
@@ -139,21 +154,6 @@
 
 =item *
 
-Call parent class's pre_capture() subroutine
-
-=cut
-
-       notify($ERRORS{'OK'}, 0, "calling parent class pre_capture() 
subroutine");
-       if ($self->SUPER::pre_capture($args)) {
-               notify($ERRORS{'OK'}, 0, "successfully executed parent class 
pre_capture() subroutine");
-       }
-       else {
-               notify($ERRORS{'WARNING'}, 0, "failed to execute parent class 
pre_capture() subroutine");
-               return 0;
-       }
-
-=item *
-
 Deactivate Windows licensing activation
 
 =cut
@@ -1399,6 +1399,24 @@
 
 #/////////////////////////////////////////////////////////////////////////////
 
+=head2 defragment_hard_drive
+
+ Parameters  : None
+ Returns     : 1
+ Description : Hard drive defragmentation is skipped for Windows version 6.x
+               (Vista and Server 2008) because it takes a very long time. This
+               subroutine always returns 1.
+
+=cut
+
+sub defragment_hard_drive {
+       # Skip hard drive defragmentation because it takes a very long time for 
Windows 6.x (Vista, 2008)
+       notify($ERRORS{'OK'}, 0, "skipping hard drive defragmentation for 
Windows 6.x because it takes too long, returning 1");
+       return 1;
+}
+
+#/////////////////////////////////////////////////////////////////////////////
+
 1;
 __END__
 

Modified: 
incubator/vcl/trunk/managementnode/lib/VCL/Module/OS/Windows/Version_6/2008.pm
URL: 
http://svn.apache.org/viewvc/incubator/vcl/trunk/managementnode/lib/VCL/Module/OS/Windows/Version_6/2008.pm?rev=807296&r1=807295&r2=807296&view=diff
==============================================================================
--- 
incubator/vcl/trunk/managementnode/lib/VCL/Module/OS/Windows/Version_6/2008.pm 
(original)
+++ 
incubator/vcl/trunk/managementnode/lib/VCL/Module/OS/Windows/Version_6/2008.pm 
Mon Aug 24 16:24:28 2009
@@ -99,8 +99,6 @@
        # Get required data
        my $imagemeta_sysprep = $self->data->get_imagemeta_sysprep();
        
-       notify($ERRORS{'OK'}, 0, "beginning Windows Server 2008 image capture 
preparation tasks");
-       
        # Call parent class's pre_capture() subroutine
        notify($ERRORS{'OK'}, 0, "calling parent class pre_capture() 
subroutine");
        if ($self->SUPER::pre_capture($args)) {
@@ -111,6 +109,8 @@
                return 0;
        }
        
+       notify($ERRORS{'OK'}, 0, "beginning Windows Server 2008 image capture 
preparation tasks");
+       
        # Check if Sysprep is to be used
        if ($imagemeta_sysprep) {
                # Run sysprep.exe and shut down the computer

Modified: 
incubator/vcl/trunk/managementnode/lib/VCL/Module/OS/Windows/Version_6/Vista.pm
URL: 
http://svn.apache.org/viewvc/incubator/vcl/trunk/managementnode/lib/VCL/Module/OS/Windows/Version_6/Vista.pm?rev=807296&r1=807295&r2=807296&view=diff
==============================================================================
--- 
incubator/vcl/trunk/managementnode/lib/VCL/Module/OS/Windows/Version_6/Vista.pm 
(original)
+++ 
incubator/vcl/trunk/managementnode/lib/VCL/Module/OS/Windows/Version_6/Vista.pm 
Mon Aug 24 16:24:28 2009
@@ -96,8 +96,6 @@
                return;
        }
        
-       notify($ERRORS{'OK'}, 0, "beginning Windows Vista image capture 
preparation tasks");
-       
        # Call parent class's pre_capture() subroutine
        notify($ERRORS{'OK'}, 0, "calling parent class pre_capture() 
subroutine");
        if ($self->SUPER::pre_capture($args)) {
@@ -108,6 +106,8 @@
                return 0;
        }
        
+       notify($ERRORS{'OK'}, 0, "beginning Windows Vista image capture 
preparation tasks");
+       
        # Prepare the computer for newsid.exe to be run
        # This shuts down the computer
        if (!$self->prepare_newsid()) {


Reply via email to