Author: arkurth
Date: Thu Jan 28 15:07:54 2010
New Revision: 904117
URL: http://svn.apache.org/viewvc?rev=904117&view=rev
Log:
VCL-301
Moved code which applies Windows security templates to earlier in the
Windows.pm::pre_capture() subroutine. This allows registry permission changes
made by the security templates to occur before other actions happen which
require the permissions. The code to disable Security Center notifications and
to set the desktop "My Computer" icon name require registry permissions to be
opened up before they are attempted.
Updated Windows.pm::delete_scheduled_task() subroutine to check for "cannot
find the file specified" in the schtasks.exe output. Windows 7 displays this
message instead of "task does not exist" when attempting to delete a task which
doesn't exist.
Added calls to set_device_path_key() in prepare_post_load() and
prepare_newsid(). This allows the DevicePath registry setting to be set if
Sysprep isn't used, allowing the computer to find the driver files copied
during image capture.
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=904117&r1=904116&r2=904117&view=diff
==============================================================================
--- incubator/vcl/trunk/managementnode/lib/VCL/Module/OS/Windows.pm (original)
+++ incubator/vcl/trunk/managementnode/lib/VCL/Module/OS/Windows.pm Thu Jan 28
15:07:54 2010
@@ -194,6 +194,18 @@
=item *
+ Apply Windows security templates
+
+=cut
+
+ # This find any .inf security template files configured for the OS and
run secedit.exe to apply them
+ if (!$self->apply_security_templates()) {
+ notify($ERRORS{'WARNING'}, 0, "unable to apply security
templates");
+ return 0;
+ }
+
+=item *
+
Disable autoadminlogon before disabling the pagefile and rebooting
=cut
@@ -293,18 +305,6 @@
if (!$self->clean_hard_drive()) {
notify($ERRORS{'WARNING'}, 0, "unable to clean unnecessary
files the hard drive");
}
-
-=item *
-
- Apply Windows security templates
-
-=cut
-
- # This find any .inf security template files configured for the OS and
run secedit.exe to apply them
- if (!$self->apply_security_templates()) {
- notify($ERRORS{'WARNING'}, 0, "unable to apply security
templates");
- return 0;
- }
=item *
@@ -2573,15 +2573,15 @@
if (defined($delete_task_exit_status) && $delete_task_exit_status == 0)
{
notify($ERRORS{'OK'}, 0, "deleted existing scheduled task
'$task_name' on $computer_node_name");
}
- elsif (defined($delete_task_output) && grep(/task.*does not exist/i,
@{$delete_task_output})) {
- notify($ERRORS{'DEBUG'}, 0, "scheduled task '$task_name' does
not already exist on $computer_node_name");
+ elsif (defined($delete_task_output) && grep(/(task.*does not
exist|cannot find the file specified)/i, @{$delete_task_output})) {
+ notify($ERRORS{'DEBUG'}, 0, "scheduled task '$task_name' does
not exist on $computer_node_name");
}
elsif (defined($delete_task_exit_status)) {
- notify($ERRORS{'WARNING'}, 0, "failed to deleted existing
scheduled task '$task_name' on $computer_node_name, exit status:
$delete_task_exit_status, output:\...@{$delete_task_output}");
+ notify($ERRORS{'WARNING'}, 0, "failed to delete existing
scheduled task '$task_name' on $computer_node_name, exit status:
$delete_task_exit_status, output:\...@{$delete_task_output}");
return 0;
}
else {
- notify($ERRORS{'WARNING'}, 0, "failed to execute ssh command
deleted existing scheduled task '$task_name' on $computer_node_name");
+ notify($ERRORS{'WARNING'}, 0, "failed to execute ssh command to
delete existing scheduled task '$task_name' on $computer_node_name");
return;
}
@@ -3151,6 +3151,13 @@
my $computer_node_name = $self->data->get_computer_node_name();
my $end_state = $self->{end_state} || 'off';
+ # Set the DevicePath registry key
+ # This is used to locate device drivers
+ if (!$self->set_device_path_key()) {
+ notify($ERRORS{'WARNING'}, 0, "failed to set the DevicePath
registry key");
+ return;
+ }
+
# Get the node configuration directory
my $node_configuration_directory =
$self->get_node_configuration_directory();
unless ($node_configuration_directory) {
@@ -3213,6 +3220,13 @@
notify($ERRORS{'CRITICAL'}, 0, "subroutine was called as a
function, it must be called as a class method");
return;
}
+
+ # Set the DevicePath registry key
+ # This is used to locate device drivers
+ if (!$self->set_device_path_key()) {
+ notify($ERRORS{'WARNING'}, 0, "failed to set the DevicePath
registry key");
+ return;
+ }
my $management_node_keys = $self->data->get_management_node_keys();
my $computer_node_name = $self->data->get_computer_node_name();
@@ -6712,7 +6726,7 @@
}
return 1;
-} ## end sub disable_ipv6
+}
#/////////////////////////////////////////////////////////////////////////////