Author: arkurth
Date: Mon May  4 18:05:48 2009
New Revision: 771382

URL: http://svn.apache.org/viewvc?rev=771382&view=rev
Log:
VCL-23
In all files being committed:
-Moved $Id: line so it appears just below the #! line at the beginning of the 
file for consistency.
-Updated POD sections at the end of the file to change NCSU information to ASF.

Changes in following files streamline the task of copying configuration files 
for the OS from the management node to a computer. If a class has a 
$SOURCE_CONFIGURATION_DIRECTORY variable set, it will be automatically copied 
to the node during the image capture process. Top-most class directories are 
copied first so subclasses can essentially override any files from above.

Module.pm:
-Added get_package_hierarchy() subroutine. It returns an array containing Perl 
package names of all of the packages which make up a module's inheritance 
hierarchy.
-Improved POD sections throughout file for better code documentation.

OS.pm:
-Added get_source_configuration_directories() subroutine. This calls 
Module.pm::get_package_hierarchy().

Windows_mod.pm:
-Fixed a few heredoc sections where double quotes should have been used instead 
of single. This caused a bug where backslashes were being duplicated in 
registry file sections being merged.
-Added firewall_enable_sessmgr() subroutine. This is helpful for Win2k3 image 
capture. Sysprep hangs because it wants sessmgr.exe allowed through the 
firewall.
-Updated copy_capture_configuration_files() to handle multiple paths. It now 
calls OS.pm::get_source_configuration_directories().
-Fixed prepare_drivers() so it works with Win2k3. The DevicePath string is a 
REG_SZ in Win2k3 instead of a REG_EXPAND_SZ.

Version_5.pm:
-Removed $SOURCE_CONFIGURATION_DIRECTORY variable because it wasn't being used.

XP_mod.pm:
-Removed call to copy_capture_configuration_files() because Windows_mod.pm now 
handles it for all inherited classes.

Modified:
    incubator/vcl/trunk/managementnode/lib/VCL/Module.pm
    incubator/vcl/trunk/managementnode/lib/VCL/Module/OS.pm
    incubator/vcl/trunk/managementnode/lib/VCL/Module/OS/Windows_mod.pm
    
incubator/vcl/trunk/managementnode/lib/VCL/Module/OS/Windows_mod/Version_5.pm
    
incubator/vcl/trunk/managementnode/lib/VCL/Module/OS/Windows_mod/Version_5/XP_mod.pm

Modified: incubator/vcl/trunk/managementnode/lib/VCL/Module.pm
URL: 
http://svn.apache.org/viewvc/incubator/vcl/trunk/managementnode/lib/VCL/Module.pm?rev=771382&r1=771381&r2=771382&view=diff
==============================================================================
--- incubator/vcl/trunk/managementnode/lib/VCL/Module.pm (original)
+++ incubator/vcl/trunk/managementnode/lib/VCL/Module.pm Mon May  4 18:05:48 
2009
@@ -1,5 +1,7 @@
 #!/usr/bin/perl -w
-
+###############################################################################
+# $Id$
+###############################################################################
 # Licensed to the Apache Software Foundation (ASF) under one or more
 # contributor license agreements.  See the NOTICE file distributed with
 # this work for additional information regarding copyright ownership.
@@ -14,10 +16,7 @@
 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 # See the License for the specific language governing permissions and
 # limitations under the License.
-
-##############################################################################
-# $Id$
-##############################################################################
+###############################################################################
 
 =head1 NAME
 
@@ -25,11 +24,42 @@
 
 =head1 SYNOPSIS
 
+In a derived module:
+
  use base qw(VCL::Module);
 
+ sub initialize {
+    my $self = shift;
+    my $image_id = $self->data->get_image_id();
+    <perform module initialization tasks...>
+    return 1;
+ }
+
 =head1 DESCRIPTION
 
- Needs to be written.
+C<VCL::Module> is the base class for the modularized VCL architecture. All VCL
+modules should inherit from C<VCL::Module> or from another class which inherits
+from C<VCL::Module> (multilevel inheritance).
+
+To inherit directly from C<VCL::Module>:
+
+C<use base qw(VCL::Module);>
+
+To inherit from a class which ultimately inherits from C<VCL::Module>:
+
+C<use base qw(VCL::Module::OS::Windows);>
+
+C<VCL::Module> provides a common constructor which all derived modules should
+use. Derived modules should not implement their own constructors. The
+constructor provides derived modules the ability to implement an 
C<initialize()>
+subroutine which will be automatically called when a derived module object is
+created. This method should be used if a module needs to perform any functions
+to initialize a newly created module object.
+
+Modules derived from C<VCL::Module> have access to the common backend
+reservation data API to access and set the data for the reservation being
+processed via C<< $self->data >>. (C<$self> being a reference to a derived
+module object)
 
 =cut
 
@@ -52,13 +82,14 @@
 use strict;
 use warnings;
 use diagnostics;
+use English '-no_match_vars';
 
-use VCL::utils qw($VERBOSE %ERRORS &notify &getnewdbh);
+use VCL::utils qw($VERBOSE %ERRORS &notify &getnewdbh format_data);
 use VCL::DataStructure;
 
 ##############################################################################
 
-=head1 OBJECT METHODS
+=head1 CONSTRUCTOR
 
 =cut
 
@@ -66,10 +97,28 @@
 
 =head2 new
 
- Parameters  : {data_structure} - reference to a VCL::DataStructure object
- Returns     : New object which inherits from VCL::Provisioning
- Description : Constructor for classes of objects derived from
-               VCL::Module::Provisioning.
+ Parameters  : Hash reference - hash must contain a key called data_structure.
+               The value of this key must be a reference to a 
VCL::DataStructure
+               object.
+ Returns     : Success - new object which inherits from VCL::Module
+               Failure - undefined
+ Description : Constructor for VCL modules. All VCL modules should use this
+               constructor. Objects created using this constructor have a base
+               class of VCL::Module. A module may have other intermediate
+               classes it is derived from if multilevel inheritance is used.
+               
+               This constructor must be passed a reference to a previously
+               created VCL::DataStructure object. Derived objects will have
+               access to the data() object method: $self->data->get...()
+               
+               During object creation, this constructor will attempt to call an
+               initialize() subroutine defined in a child class. This allows
+               tasks to be automatically performed during object creation.
+               Implementing an initialize() subroutine is optional.
+ 
+               Example:
+               use VCL::Module::TestModule;
+               my $test_module = new VCL::Module::TestModule({data_structure 
=> $self->data});
 
 =cut
 
@@ -85,13 +134,13 @@
        # Make sure the data structure was passed as an argument called 
'data_structure'
        if (!defined $args->{data_structure}) {
                notify($ERRORS{'CRITICAL'}, 0, "required 'data_structure' 
argument was not passed");
-               return 0;
+               return;
        }
 
        # Make sure the 'data_structure' argument contains a VCL::DataStructure 
object
        if (ref $args->{data_structure} ne 'VCL::DataStructure') {
                notify($ERRORS{'CRITICAL'}, 0, "'data_structure' argument 
passed is not a reference to a VCL::DataStructure object");
-               return 0;
+               return;
        }
 
        # Add the DataStructure reference to the class object
@@ -105,22 +154,27 @@
        if ($class_object->can("initialize")) {
                # Call the initialize() subroutine, if it returns 0, return 0
                # If it doesn't return 0, return the object reference
-               return 0 if (!$class_object->initialize());
+               return if (!$class_object->initialize());
        }
 
        return $class_object;
 } ## end sub new
 
+##############################################################################
+
+=head1 OBJECT METHODS
+
+=cut
+
 #/////////////////////////////////////////////////////////////////////////////
 
 =head2 data
 
  Parameters  : None
- Returns     : Reference to the DataStructure object belonging to the class
-               instance
- Description : This data() subroutine allows derived instances to easily
-               retrieve data from the DataStructure as follows:
-               my $image_id = $self->data->get_image_id;
+ Returns     : Reference to the DataStructure object
+ Description : This subroutine allows VCL module objects to retrieve data using
+               the object's DataStructure object as follows:
+               my $image_id = $self->data->get_image_id();
 
 =cut
 
@@ -145,21 +199,129 @@
 
 #/////////////////////////////////////////////////////////////////////////////
 
-1;
-__END__
+=head2 get_package_hierarchy
+
+ Parameters  : String containing the name of a Perl package
+               (note: parameter is optional if called as an object method,
+               required if called as a class function
+ Returns     : Array containing class package names
+ Description : Determines the Perl package inheritance hierarchy given a
+               package name or object reference.
+               
+               Returns an array containing the names of the originating
+               Perl package and any parent packages it inherits from.
+               
+               This subroutine does not support multiple inheritance.
+               If any package up the chain inherits from multiple classes,
+               only the first class listed in the package's @ISA array is
+               used.
+               
+               The package name on which this subroutine is called is the
+               lowest in the hierarchy and has the lowest index in the
+               array.
+               
+               If the package on which this subroutine is called does not
+               explicitly inherit from any other packages, the array
+               returned will only contain 1 element which is the calling
+               package name.
+               
+               Example: call as object method:
+               my $os = 
VCL::Module::OS::Windows_mod::Version_5::XP_mod->new({data_structure => 
$self->data});
+               my @packages = $os->get_package_hierarchy();
+               
+               Example: call as class function:
+               my @packages = 
get_package_hierarchy("VCL::Module::OS::Windows_mod::Version_5::XP_mod");
+               
+               Both examples return the following array:
+               [0] = 'VCL::Module::OS::Windows_mod::Version_5::XP_mod'
+               [1] = 'VCL::Module::OS::Windows_mod::Version_5'
+               [2] = 'VCL::Module::OS::Windows_mod'
+               [3] = 'VCL::Module::OS'
+               [4] = 'VCL::Module'
 
-=head1 BUGS and LIMITATIONS
 
- There are no known bugs in this module.
- Please report problems to the VCL team (vcl_h...@ncsu.edu).
+=cut
+
+sub get_package_hierarchy {
+       my $argument = shift;
+       if (!$argument) {
+               notify($ERRORS{'WARNING'}, 0, "subroutine was not called as an 
object method and argument was not passed");
+               return;
+       }
+       
+       my @return_package_names;
+       my $package_name;
+       
+       # Check if this was called as an object method
+       # If it was, check if an argument was supplied
+       if (ref($argument) && $argument->isa('VCL::Module')) {
+               my $argument2 = shift;
+               # If called as object method and argument was supplied, use the 
argument
+               $argument = $argument2 if defined($argument2);
+       }
+       
+       # Check if argument is an object reference or a package name string
+       if (ref($argument)) {
+               # Argument is a reference, get package hierarchy of object type 
which called this
+               # Add the calling package name as the first element of the 
return array
+               $package_name = ref($argument);
+               push @return_package_names, $package_name;
+       }
+       else {
+               # Argument is not a reference, assume argument is a string 
containing a package name
+               $package_name = $argument;
+       }
+       notify($ERRORS{'DEBUG'}, 0, "finding package hierarchy for: 
$package_name");
+       
+       # Use eval to retrieve the package name's @ISA array
+       my @package_isa = eval '@' . $package_name . '::ISA';
+       if ($EVAL_ERROR) {
+               notify($ERRORS{'WARNING'}, 0, "unable to determine \...@isa 
array for package: $package_name, error:\n$EVAL_ERROR");
+               return;
+       }
+       
+       # Get the number of elements in the package's @ISA array
+       my $package_isa_count = scalar @package_isa;
+       
+       # Check if @ISA is empty
+       if ($package_isa_count == 0) {
+               notify($ERRORS{'DEBUG'}, 0, "$package_name has no parent 
packages");
+               return ();
+       }
+       
+       notify($ERRORS{'DEBUG'}, 0, "parent package names for $package_name:\n" 
. format_data(\...@package_isa));
+       my $parent_package_name = $package_isa[0];
+       
+       # Warn if package uses multiple inheritance, only use 1st element of 
package's @ISA array
+       if ($package_isa_count > 1) {
+               notify($ERRORS{'WARNING'}, 0, "$package_name has multiple 
parent packages, only using $parent_package_name");
+       }
+       
+       # Add this package's parent package name to the return array
+       push @return_package_names, $parent_package_name;
+       
+       # Recursively call this sub on the parent package and add the results 
to the return array
+       push @return_package_names, get_package_hierarchy($parent_package_name);
+       
+       notify($ERRORS{'DEBUG'}, 0, "returning for $package_name:\n" . 
format_data(\...@return_package_names));
+       return @return_package_names;
+}
+
+#/////////////////////////////////////////////////////////////////////////////
+
+1;
+__END__
 
-=head1 AUTHOR
+=head1 COPYRIGHT
 
- Aaron Peeler, aaron_pee...@ncsu.edu
- Andy Kurth, andy_ku...@ncsu.edu
+ Apache VCL incubator project
+ Copyright 2009 The Apache Software Foundation
+ 
+ This product includes software developed at
+ The Apache Software Foundation (http://www.apache.org/).
 
 =head1 SEE ALSO
 
-L<http://vcl.ncsu.edu>
+L<http://cwiki.apache.org/VCL/>
 
 =cut

Modified: incubator/vcl/trunk/managementnode/lib/VCL/Module/OS.pm
URL: 
http://svn.apache.org/viewvc/incubator/vcl/trunk/managementnode/lib/VCL/Module/OS.pm?rev=771382&r1=771381&r2=771382&view=diff
==============================================================================
--- incubator/vcl/trunk/managementnode/lib/VCL/Module/OS.pm (original)
+++ incubator/vcl/trunk/managementnode/lib/VCL/Module/OS.pm Mon May  4 18:05:48 
2009
@@ -1,5 +1,7 @@
 #!/usr/bin/perl -w
-
+###############################################################################
+# $Id$
+###############################################################################
 # Licensed to the Apache Software Foundation (ASF) under one or more
 # contributor license agreements.  See the NOTICE file distributed with
 # this work for additional information regarding copyright ownership.
@@ -14,10 +16,7 @@
 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 # See the License for the specific language governing permissions and
 # limitations under the License.
-
-##############################################################################
-# $Id$
-##############################################################################
+###############################################################################
 
 =head1 NAME
 
@@ -52,7 +51,7 @@
 use strict;
 use warnings;
 use diagnostics;
-
+use English '-no_match_vars';
 use VCL::utils;
 
 ##############################################################################
@@ -102,22 +101,87 @@
 
 #/////////////////////////////////////////////////////////////////////////////
 
-1;
-__END__
+=head2 get_source_configuration_directories
 
-=head1 BUGS and LIMITATIONS
+ Parameters  : None
+ Returns     : Array containing filesystem path strings
+ Description : Retrieves the $SOURCE_CONFIGURATION_DIRECTORY variable value for
+               the classes which the OS object is a member of and returns an
+               array containing these values.
+               
+               The first element of the array contains the value from the
+               top-most class where the $SOURCE_CONFIGURATION_DIRECTORY 
variable
+               was defined. The last element contains the value from the
+               bottom-most class, which is probably the class which was
+               instantiated.
+               
+               Example: An Windows XP OS object is instantiated from the XP
+               class, which is a subclass of the Version_5 class, which is a
+               subclass of the Windows class:
+               
+               VCL::Module::OS::Windows
+               ^
+               VCL::Module::OS::Windows::Version_5
+               ^
+               VCL::Module::OS::Windows::Version_5::XP
+               
+               The XP and Windows classes each
+               have a $SOURCE_CONFIGURATION_DIRECTORY variable defined but the
+               Version_5 class does not. The array returned will be:
+               
+               [0] = '/usr/local/vcldev/current/bin/../tools/Windows'
+               [1] = '/usr/local/vcldev/current/bin/../tools/Windows_XP'
 
- There are no known bugs in this module.
- Please report problems to the VCL team (vcl_h...@ncsu.edu).
+=cut
 
-=head1 AUTHOR
+sub get_source_configuration_directories {
+       my $self = shift;
+       unless (ref($self) && $self->isa('VCL::Module')) {
+               notify($ERRORS{'CRITICAL'}, 0, "subroutine can only be called 
as a VCL module object method");
+               return; 
+       }
+       
+       # Get an array containing the names of the Perl packages the OS object 
is a class of
+       my @package_hierarchy = $self->get_package_hierarchy();
+       
+       # Loop through each classes, retrieve any which have a 
$SOURCE_CONFIGURATION_DIRECTORY variable defined
+       my @directories = ();
+       for my $package_name (@package_hierarchy) {
+               my $source_configuration_directory = eval '$' . $package_name . 
'::SOURCE_CONFIGURATION_DIRECTORY';
+               if ($EVAL_ERROR) {
+                       notify($ERRORS{'WARNING'}, 0, "unable to determine 
source configuration directory for $package_name, error:\n$EVAL_ERROR");
+                       next;   
+               }
+               elsif (!$source_configuration_directory) {
+                       notify($ERRORS{'DEBUG'}, 0, "source configuration 
directory is not defined for $package_name");
+                       next;
+               }
+               
+               notify($ERRORS{'DEBUG'}, 0, "package source configuration 
directory: $source_configuration_directory");
+               
+               # Add the directory path to the return array
+               # Use unshift to add to the beginning to the array
+               unshift @directories, $source_configuration_directory; 
+       }
+       
+       return @directories;
+}
+
+#/////////////////////////////////////////////////////////////////////////////
+
+1;
+__END__
 
- Aaron Peeler, aaron_pee...@ncsu.edu
- Andy Kurth, andy_ku...@ncsu.edu
+=head1 COPYRIGHT
 
-=head1 SEE ALSO
+ Apache VCL incubator project
+ Copyright 2009 The Apache Software Foundation
+ 
+ This product includes software developed at
+ The Apache Software Foundation (http://www.apache.org/).
 
-L<http://vcl.ncsu.edu>
+=head1 SEE ALSO
 
+L<http://cwiki.apache.org/VCL/>
 
 =cut

Modified: incubator/vcl/trunk/managementnode/lib/VCL/Module/OS/Windows_mod.pm
URL: 
http://svn.apache.org/viewvc/incubator/vcl/trunk/managementnode/lib/VCL/Module/OS/Windows_mod.pm?rev=771382&r1=771381&r2=771382&view=diff
==============================================================================
--- incubator/vcl/trunk/managementnode/lib/VCL/Module/OS/Windows_mod.pm 
(original)
+++ incubator/vcl/trunk/managementnode/lib/VCL/Module/OS/Windows_mod.pm Mon May 
 4 18:05:48 2009
@@ -1,5 +1,7 @@
 #!/usr/bin/perl -w
-
+###############################################################################
+# $Id$
+###############################################################################
 # Licensed to the Apache Software Foundation (ASF) under one or more
 # contributor license agreements.  See the NOTICE file distributed with
 # this work for additional information regarding copyright ownership.
@@ -14,14 +16,11 @@
 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 # See the License for the specific language governing permissions and
 # limitations under the License.
-
-##############################################################################
-# $Id$
-##############################################################################
+###############################################################################
 
 =head1 NAME
 
-VCL::Module::OS::Windows::Desktop
+VCL::Module::OS::Windows_mod - Windows OS support module
 
 =head1 SYNOPSIS
 
@@ -53,7 +52,7 @@
 use strict;
 use warnings;
 use diagnostics;
-
+use English '-no_match_vars';
 use VCL::utils;
 use File::Basename;
 
@@ -158,22 +157,11 @@
 
 =item *
 
-Delete existing capture configuration files from the computer (scripts, 
utilities, drivers...)
-
-=cut
-
-       if (!$self->delete_capture_configuration_files()) {
-               notify($ERRORS{'WARNING'}, 0, "unable to delete existing 
capture configuration files to $computer_node_name");
-               return 0;
-       }
-
-=item *
-
 Copy the capture configuration files to the computer (scripts, utilities, 
drivers...)
 
 =cut
 
-       if 
(!$self->copy_capture_configuration_files($SOURCE_CONFIGURATION_DIRECTORY)) {
+       if (!$self->copy_capture_configuration_files()) {
                notify($ERRORS{'WARNING'}, 0, "unable to copy general Windows 
capture configuration files to $computer_node_name");
                return 0;
        }
@@ -1032,7 +1020,7 @@
 
                # Remove duplicate users
                @users = keys %{{map {$_, 1} @users}};
-       } ## end else [ if ($user_array_ref)
+       }
 
        notify($ERRORS{'DEBUG'}, 0, "attempting to add " . scalar @users . " 
users to $computer_node_name: " . join(", ", @users));
 
@@ -1575,7 +1563,7 @@
        my $management_node_keys = $self->data->get_management_node_keys();
        my $computer_node_name   = $self->data->get_computer_node_name();
 
-       my $registry_string .= <<'EOF';
+       my $registry_string .= <<"EOF";
 Windows Registry Editor Version 5.00
 
 [HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\Session 
Manager\\Memory Management]
@@ -1614,7 +1602,7 @@
        my $management_node_keys = $self->data->get_management_node_keys();
        my $computer_node_name   = $self->data->get_computer_node_name();
 
-       my $registry_string .= <<'EOF';
+       my $registry_string .= <<"EOF";
 Windows Registry Editor Version 5.00
 
 ; This registry file contains the entries to disable all IPv6 components 
@@ -2627,7 +2615,7 @@
                $computer_name = "$computer_short_name-$image_id";
        }
 
-       my $registry_string .= <<'EOF';
+       my $registry_string .= <<"EOF";
 Windows Registry Editor Version 5.00
 
 ; This registry file contains the entries to bypass the license agreement when 
newsid.exe is run
@@ -3777,6 +3765,42 @@
 
 #/////////////////////////////////////////////////////////////////////////////
 
+=head2 firewall_enable_sessmgr
+
+ Parameters  : 
+ Returns     : 1 if succeeded, 0 otherwise
+ Description : 
+
+=cut
+
+sub firewall_enable_sessmgr {
+       my $self = shift;
+       if (ref($self) !~ /windows/i) {
+               notify($ERRORS{'CRITICAL'}, 0, "subroutine was called as a 
function, it must be called as a class method");
+               return;
+       }
+       
+       my $management_node_keys = $self->data->get_management_node_keys();
+       my $computer_node_name   = $self->data->get_computer_node_name();
+
+       # Configure the firewall to allow the sessmgr.exe program
+       my $netsh_command = "netsh firewall set allowedprogram name = 
\"Microsoft Remote Desktop Help Session Manager\" mode = ENABLE scope = ALL 
profile = ALL program = \"\$SYSTEMROOT\\system32\\sessmgr.exe\"";
+       my ($netsh_status, $netsh_output) = 
run_ssh_command($computer_node_name, $management_node_keys, $netsh_command);
+       if (defined($netsh_status) && $netsh_status == 0) {
+               notify($ERRORS{'DEBUG'}, 0, "configured firewall to allow 
sessmgr.exe");
+       }
+       elsif (defined($netsh_status)) {
+               notify($ERRORS{'WARNING'}, 0, "failed to configure firewall to 
allow sessmgr.exe, exit status: $netsh_status, output:\...@{$netsh_output}");
+       }
+       else {
+               notify($ERRORS{'WARNING'}, 0, "unable to run ssh command to 
configure firewall to allow sessmgr.exe");
+       }
+       
+       return 1;
+}
+
+#/////////////////////////////////////////////////////////////////////////////
+
 =head2 allow_remote_access
 
  Parameters  : 
@@ -4917,47 +4941,57 @@
 
 sub copy_capture_configuration_files {
        my $self = shift;
-       if (ref($self) !~ /windows/i) {
-               notify($ERRORS{'CRITICAL'}, 0, "subroutine was called as a 
function, it must be called as a class method");
-               return;
+       unless (ref($self) && $self->isa('VCL::Module')) {
+               notify($ERRORS{'CRITICAL'}, 0, "subroutine can only be called 
as a VCL module object method");
+               return; 
        }
 
        my $management_node_keys = $self->data->get_management_node_keys();
        my $computer_node_name   = $self->data->get_computer_node_name();
-
-       # Get the source configuration directory
-       my $source_configuration_directory = shift;
-       if (!$source_configuration_directory) {
-               notify($ERRORS{'WARNING'}, 0, "source configuration directory 
was not specified as an argument");
-               return 0;
+       
+       # Get an array containing the configuration directory paths on the 
management node
+       # This is made up of all the the $SOURCE_CONFIGURATION_DIRECTORY values 
for the OS class and it's parent classes
+       # The first array element is the value from the top-most class the OS 
object inherits from
+       my @source_configuration_directories = 
$self->get_source_configuration_directories();
+       if (!...@source_configuration_directories) {
+               notify($ERRORS{'WARNING'}, 0, "unable to retrieve source 
configuration directories");
+               return;
+       }
+       
+       # Delete existing configuration directory if it exists
+       if (!$self->delete_capture_configuration_files()) {
+               notify($ERRORS{'WARNING'}, 0, "unable to delete existing 
capture configuration files");
+               return;
        }
 
-       # Attempt to create the node configuration directory if it doesn't 
already exist
+       # Attempt to create the configuration directory if it doesn't already 
exist
        if (!$self->create_directory($NODE_CONFIGURATION_DIRECTORY)) {
                notify($ERRORS{'WARNING'}, 0, "unable to create directory on 
$computer_node_name: $NODE_CONFIGURATION_DIRECTORY");
                return;
        }
 
        # Copy configuration files
-       notify($ERRORS{'OK'}, 0, "copying image capture configuration files 
from $source_configuration_directory to $computer_node_name");
-       if (run_scp_command("$source_configuration_directory/*", 
"$computer_node_name:$NODE_CONFIGURATION_DIRECTORY", $management_node_keys)) {
-               notify($ERRORS{'OK'}, 0, "copied 
$source_configuration_directory directory to 
$computer_node_name:$NODE_CONFIGURATION_DIRECTORY");
-
-               notify($ERRORS{'DEBUG'}, 0, "attempting to set permissions on 
$computer_node_name:$NODE_CONFIGURATION_DIRECTORY");
-               if (run_ssh_command($computer_node_name, $management_node_keys, 
"/usr/bin/chmod.exe -R 777 $NODE_CONFIGURATION_DIRECTORY")) {
-                       notify($ERRORS{'OK'}, 0, "chmoded -R 777 
$computer_node_name:$NODE_CONFIGURATION_DIRECTORY");
-               }
+       for my $source_configuration_directory 
(@source_configuration_directories) {
+               notify($ERRORS{'OK'}, 0, "copying image capture configuration 
files from $source_configuration_directory to $computer_node_name");
+               if (run_scp_command("$source_configuration_directory/*", 
"$computer_node_name:$NODE_CONFIGURATION_DIRECTORY", $management_node_keys)) {
+                       notify($ERRORS{'OK'}, 0, "copied 
$source_configuration_directory directory to 
$computer_node_name:$NODE_CONFIGURATION_DIRECTORY");
+       
+                       notify($ERRORS{'DEBUG'}, 0, "attempting to set 
permissions on $computer_node_name:$NODE_CONFIGURATION_DIRECTORY");
+                       if (run_ssh_command($computer_node_name, 
$management_node_keys, "/usr/bin/chmod.exe -R 777 
$NODE_CONFIGURATION_DIRECTORY")) {
+                               notify($ERRORS{'OK'}, 0, "chmoded -R 777 
$computer_node_name:$NODE_CONFIGURATION_DIRECTORY");
+                       }
+                       else {
+                               notify($ERRORS{'WARNING'}, 0, "could not chmod 
-R 777 $computer_node_name:$NODE_CONFIGURATION_DIRECTORY");
+                               return;
+                       }
+               } ## end if 
(run_scp_command("$source_configuration_directory/*"...
                else {
-                       notify($ERRORS{'WARNING'}, 0, "could not chmod -R 777 
$computer_node_name:$NODE_CONFIGURATION_DIRECTORY");
+                       notify($ERRORS{'WARNING'}, 0, "failed to copy 
$source_configuration_directory to $computer_node_name");
                        return;
                }
-       } ## end if (run_scp_command("$source_configuration_directory/*"...
-       else {
-               notify($ERRORS{'WARNING'}, 0, "failed to copy 
$source_configuration_directory to $computer_node_name");
-               return;
        }
        
-       # Insert the Windows root password in any files containing 
'WINDOWS_ROOT_PASSWORD'
+       # Find any files containing a 'WINDOWS_ROOT_PASSWORD' string and 
replace it with the root password
        if ($self->search_and_replace_in_files($NODE_CONFIGURATION_DIRECTORY, 
'WINDOWS_ROOT_PASSWORD', $WINDOWS_ROOT_PASSWORD)) {
                notify($ERRORS{'DEBUG'}, 0, "set the Windows root password in 
configuration files");
        }
@@ -5026,6 +5060,13 @@
                notify($ERRORS{'WARNING'}, 0, "unable to copy and scan 
drivers");
                return 0;
        }
+       
+       # Configure the firewall to allow the sessmgr.exe program
+       # Sysprep may hang with a dialog box asking to allow this program
+       if (!$self->firewall_enable_sessmgr()) {
+               notify($ERRORS{'WARNING'}, 0, "unable to configure firewall to 
allow sessmgr.exe program, Sysprep may hang");
+               return 0;
+       }
 
        # Clear out setupapi.log
        my $setupapi_command = "/bin/cat C:/Windows/setupapi.log >> 
C:/Windows/setupapi_save.log && /bin/cp /dev/null C:/Windows/setupapi.log";
@@ -5164,8 +5205,8 @@
        }
        
        # Format the string for the log output
-       my ($device_path_string) = grep(/devicepath\s+reg_expand_sz/i, 
@{$reg_query_output});
-       $device_path_string =~ s/.*(devicepath\s+reg_expand_sz)\s*/$1\n/i;
+       my ($device_path_string) = grep(/devicepath\s+(reg_.*sz)/i, 
@{$reg_query_output});
+       $device_path_string =~ s/.*(devicepath\s+reg_.*sz)\s*/$1\n/i;
        $device_path_string =~ s/;/\n/g;
        notify($ERRORS{'OK'}, 0, "device path string: $device_path_string");
        
@@ -5641,19 +5682,16 @@
 1;
 __END__
 
-=head1 BUGS and LIMITATIONS
-
- There are no known bugs in this module.
- Please report problems to the VCL team (vcl_h...@ncsu.edu).
+=head1 COPYRIGHT
 
-=head1 AUTHOR
-
- Aaron Peeler, aaron_pee...@ncsu.edu
- Andy Kurth, andy_ku...@ncsu.edu
+ Apache VCL incubator project
+ Copyright 2009 The Apache Software Foundation
+ 
+ This product includes software developed at
+ The Apache Software Foundation (http://www.apache.org/).
 
 =head1 SEE ALSO
 
-L<http://vcl.ncsu.edu>
-
+L<http://cwiki.apache.org/VCL/>
 
 =cut

Modified: 
incubator/vcl/trunk/managementnode/lib/VCL/Module/OS/Windows_mod/Version_5.pm
URL: 
http://svn.apache.org/viewvc/incubator/vcl/trunk/managementnode/lib/VCL/Module/OS/Windows_mod/Version_5.pm?rev=771382&r1=771381&r2=771382&view=diff
==============================================================================
--- 
incubator/vcl/trunk/managementnode/lib/VCL/Module/OS/Windows_mod/Version_5.pm 
(original)
+++ 
incubator/vcl/trunk/managementnode/lib/VCL/Module/OS/Windows_mod/Version_5.pm 
Mon May  4 18:05:48 2009
@@ -1,5 +1,7 @@
 #!/usr/bin/perl -w
-
+###############################################################################
+# $Id$
+###############################################################################
 # Licensed to the Apache Software Foundation (ASF) under one or more
 # contributor license agreements.  See the NOTICE file distributed with
 # this work for additional information regarding copyright ownership.
@@ -14,10 +16,7 @@
 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 # See the License for the specific language governing permissions and
 # limitations under the License.
-
-##############################################################################
-# $Id$
-##############################################################################
+###############################################################################
 
 =head1 NAME
 
@@ -59,23 +58,6 @@
 
 ##############################################################################
 
-=head1 CLASS VARIABLES
-
-=cut
-
-=head2 $SOURCE_CONFIGURATION_DIRECTORY
-
- Data type   : Scalar
- Description : Location on management node of script/utilty/configuration
-               files needed to configure the OS. This is normally the directory
-                                       under the 'tools' directory specific to 
this OS.
-
-=cut
-
-our $SOURCE_CONFIGURATION_DIRECTORY = "$TOOLS/Windows_5";
-
-##############################################################################
-
 =head1 INTERFACE OBJECT METHODS
 
 =cut
@@ -126,29 +108,16 @@
 1;
 __END__
 
-=head1 BUGS and LIMITATIONS
-
- There are no known bugs in this module.
- Please report problems to the VCL team (vcl_h...@ncsu.edu).
+=head1 COPYRIGHT
 
-=head1 AUTHOR
-
- Aaron Peeler, aaron_pee...@ncsu.edu
- Andy Kurth, andy_ku...@ncsu.edu
+ Apache VCL incubator project
+ Copyright 2009 The Apache Software Foundation
+ 
+ This product includes software developed at
+ The Apache Software Foundation (http://www.apache.org/).
 
 =head1 SEE ALSO
 
-L<http://vcl.ncsu.edu>
-
-=head1 COPYRIGHT AND LICENSE
-
- Copyright (C) 2004-2008 by NC State University. All Rights Reserved.
-
- Virtual Computing Laboratory
- North Carolina State University
- Raleigh, NC, USA 27695
-
- For use license and copyright information see LICENSE and COPYRIGHT files
- included in the source files.
+L<http://cwiki.apache.org/VCL/>
 
 =cut

Modified: 
incubator/vcl/trunk/managementnode/lib/VCL/Module/OS/Windows_mod/Version_5/XP_mod.pm
URL: 
http://svn.apache.org/viewvc/incubator/vcl/trunk/managementnode/lib/VCL/Module/OS/Windows_mod/Version_5/XP_mod.pm?rev=771382&r1=771381&r2=771382&view=diff
==============================================================================
--- 
incubator/vcl/trunk/managementnode/lib/VCL/Module/OS/Windows_mod/Version_5/XP_mod.pm
 (original)
+++ 
incubator/vcl/trunk/managementnode/lib/VCL/Module/OS/Windows_mod/Version_5/XP_mod.pm
 Mon May  4 18:05:48 2009
@@ -1,5 +1,7 @@
 #!/usr/bin/perl -w
-
+###############################################################################
+# $Id$
+###############################################################################
 # Licensed to the Apache Software Foundation (ASF) under one or more
 # contributor license agreements.  See the NOTICE file distributed with
 # this work for additional information regarding copyright ownership.
@@ -14,10 +16,7 @@
 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 # See the License for the specific language governing permissions and
 # limitations under the License.
-
-##############################################################################
-# $Id$
-##############################################################################
+###############################################################################
 
 =head1 NAME
 
@@ -119,12 +118,6 @@
                return 0;
        }
        
-       # Copy the capture configuration files to the computer (scripts, 
utilities, drivers...)
-       if 
(!$self->copy_capture_configuration_files($SOURCE_CONFIGURATION_DIRECTORY)) {
-               notify($ERRORS{'WARNING'}, 0, "capture preparation failed, 
unable to copy XP-specific capture configuration files");
-               return 0;
-       }
-       
        # Check if Sysprep should be used
        if ($imagemeta_sysprep) {
                # Copy the Sysprep files to C:\Sysprep
@@ -144,29 +137,16 @@
 1;
 __END__
 
-=head1 BUGS and LIMITATIONS
-
- There are no known bugs in this module.
- Please report problems to the VCL team (vcl_h...@ncsu.edu).
+=head1 COPYRIGHT
 
-=head1 AUTHOR
-
- Aaron Peeler, aaron_pee...@ncsu.edu
- Andy Kurth, andy_ku...@ncsu.edu
+ Apache VCL incubator project
+ Copyright 2009 The Apache Software Foundation
+ 
+ This product includes software developed at
+ The Apache Software Foundation (http://www.apache.org/).
 
 =head1 SEE ALSO
 
-L<http://vcl.ncsu.edu>
-
-=head1 COPYRIGHT AND LICENSE
-
- Copyright (C) 2004-2008 by NC State University. All Rights Reserved.
-
- Virtual Computing Laboratory
- North Carolina State University
- Raleigh, NC, USA 27695
-
- For use license and copyright information see LICENSE and COPYRIGHT files
- included in the source files.
+L<http://cwiki.apache.org/VCL/>
 
 =cut


Reply via email to