You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@vcl.apache.org by ar...@apache.org on 2009/06/15 21:21:23 UTC

svn commit: r784927 - /incubator/vcl/trunk/managementnode/lib/VCL/Module/OS/Windows_mod.pm

Author: arkurth
Date: Mon Jun 15 19:21:23 2009
New Revision: 784927

URL: http://svn.apache.org/viewvc?rev=784927&view=rev
Log:
VCL-160
Modified Windows_mod.pm::prepare_drivers() to delete existing DevicePath key before running spdrvscn.exe. Also fixed a bug if the driver directory didn't exist beforehand by adding mkdir -p command before attempting to copy drivers.

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

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=784927&r1=784926&r2=784927&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 Jun 15 19:21:23 2009
@@ -5878,7 +5878,7 @@
 	}
 	
 	# Copy driver files to C:/Drivers
-	my $cp_command = "cp -rf \"$NODE_CONFIGURATION_DIRECTORY/Drivers\" \"$driver_directory\"";
+	my $cp_command = "mkdir -p \"$driver_directory\" && cp -rf \"$NODE_CONFIGURATION_DIRECTORY/Drivers\" \"$driver_directory\"";
 	my ($cp_status, $cp_output) = run_ssh_command($computer_node_name, $management_node_keys, $cp_command);
 	if (defined($cp_status) && $cp_status == 0) {
 		notify($ERRORS{'DEBUG'}, 0, "copied driver files to $driver_directory");
@@ -5891,6 +5891,21 @@
 		notify($ERRORS{'WARNING'}, 0, "unable to run ssh command to drivers files to $driver_directory");
 		return 0;
 	}
+	
+	# Delete existing DevicePath key
+	my $reg_del_command = '$SYSTEMROOT/System32/reg.exe DELETE "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion" /v DevicePath /f';
+	my ($reg_del_status, $reg_del_output) = run_ssh_command($computer_node_name, $management_node_keys, $reg_del_command);
+	if (defined($reg_del_status) && $reg_del_status == 0) {
+		notify($ERRORS{'DEBUG'}, 0, "deleted existing DevicePath key");
+	}
+	elsif (defined($reg_del_status)) {
+		notify($ERRORS{'OK'}, 0, "failed to delete existing DevicePath key, exit status: $reg_del_status, output:\n@{$reg_del_output}");
+		return 0;
+	}
+	else {
+		notify($ERRORS{'WARNING'}, 0, "unable to run ssh command to delete existing DevicePath key");
+		return 0;
+	}
 
 	# Run spdrvscn.exe
 	my $spdrvscn_command = "$NODE_CONFIGURATION_DIRECTORY/Utilities/SPDrvScn/spdrvscn.exe /p \"$driver_directory\" /e inf /d \$SYSTEMROOT\\\\inf /a /s /q";