Author: arkurth
Date: Mon Oct 10 18:20:25 2011
New Revision: 1181111

URL: http://svn.apache.org/viewvc?rev=1181111&view=rev
Log:
VCL-523
Changed path where temporary reg file is stored from %TMP% to C:/cygwin/tmp in 
Windows.pm::get_service_configuration. The %TMP% variable isn't always 
available. Also updated reg_export to be able to handle spaces in the reg file 
path argument.

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=1181111&r1=1181110&r2=1181111&view=diff
==============================================================================
--- incubator/vcl/trunk/managementnode/lib/VCL/Module/OS/Windows.pm (original)
+++ incubator/vcl/trunk/managementnode/lib/VCL/Module/OS/Windows.pm Mon Oct 10 
18:20:25 2011
@@ -2824,7 +2824,7 @@ sub reg_export {
        $root_key =~ s/\//\\\\/g;
        
        # Run reg.exe EXPORT
-       my $command .= "cmd.exe /c \"$system32_path/reg.exe EXPORT $root_key 
$registry_file_path.tmp /y && type $registry_file_path.tmp > 
$registry_file_path\"";
+       my $command .= "cmd.exe /c \"$system32_path/reg.exe EXPORT $root_key 
\\\"$registry_file_path.tmp\\\" /y && type \\\"$registry_file_path.tmp\\\" > 
\\\"$registry_file_path\\\" && del -q \\\"$registry_file_path.tmp\\\"\"";
        my ($exit_status, $output) = run_ssh_command($computer_node_name, 
$management_node_keys, $command, '', '', 1);
        if (!defined($output)) {
                notify($ERRORS{'WARNING'}, 0, "failed to run SSH command to 
export registry key $root_key to file: $registry_file_path");
@@ -3870,7 +3870,7 @@ sub get_service_configuration {
        
        notify($ERRORS{'DEBUG'}, 0, "retrieving service configuration 
information from the registry");
        my $services_key = 
'HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Services';
-       my $node_reg_file_path = "\$TMP/services_$computer_node_name.reg";
+       my $node_reg_file_path = 
"C:/cygwin/tmp/services_$computer_node_name.reg";
        if (!$self->reg_export($services_key, $node_reg_file_path)) {
                notify($ERRORS{'WARNING'}, 0, "failed to retrieve service 
credential information from the registry on $computer_node_name");
                return;
@@ -3882,6 +3882,9 @@ sub get_service_configuration {
                return;
        }
        
+       # Delete the registry file
+       $self->delete_file($node_reg_file_path);
+       
        my $service_configuration;
        my $service_name;
        for my $line (@reg_file_contents) {


Reply via email to