Author: arkurth
Date: Mon Sep 20 20:43:30 2010
New Revision: 999112

URL: http://svn.apache.org/viewvc?rev=999112&view=rev
Log:
VCL-196
Fixed bug in reg_query which affects Windows 6.x.  The reg.exe QUERY output is 
slightly different for Windows 5.x and 6.x.  The output fields in 5.x are 
separated with tabs whereas 6.x uses multiple spaces.  Fixed the regular 
expression to locate spaces rather than tabs.

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=999112&r1=999111&r2=999112&view=diff
==============================================================================
--- incubator/vcl/trunk/managementnode/lib/VCL/Module/OS/Windows.pm (original)
+++ incubator/vcl/trunk/managementnode/lib/VCL/Module/OS/Windows.pm Mon Sep 20 
20:43:30 2010
@@ -2431,7 +2431,7 @@ sub reg_query {
        # If value argument was specified, parse and return the data
        if (defined($value_argument)) {
                # Find the line containing the value information and parse it
-               my ($value, $type, $data) = map { $_ =~ 
/^\s+([^\t]+)\t(REG_\w+)\t?(.*)/ } @$output;
+               my ($value, $type, $data) = map { $_ =~ 
/^\s*([^\t]+)\s*(REG_\w+)\s*(.*)/ } @$output;
                $value = '(Default)' if $value eq '<NO NAME>';
                if ($type && defined($data)) {
                        $data = $self->reg_query_convert_data($type, $data);
@@ -2439,7 +2439,7 @@ sub reg_query {
                        return $data;
                }
                else {
-                       notify($ERRORS{'WARNING'}, 0, "failed to retrieve 
registry data:\nkey: '$key_argument'\nvalue: '$value'\ncommand: 
'$command'\noutput:\n" . join("\n", @$output));
+                       notify($ERRORS{'WARNING'}, 0, "failed to retrieve 
registry data:\nkey: '$key_argument'\nvalue: '$value'\ncommand: 
'$command'\noutput:\n" . string_to_ascii(join("\n", @$output)));
                        return;
                }
        }
@@ -2457,7 +2457,7 @@ sub reg_query {
                                $registry_hash{$key} = {};
                                next;
                        }
-                       elsif ($line =~ /^\s+([^\t]+)\t(REG_\w+)\t(.*)/) {
+                       elsif ($line =~ /^\s*([^\t]+)\s*(REG_\w+)\s*(.*)/) {
                                my ($value, $type, $data) = ($1, $2, $3);
                                $value = '(Default)' if $value eq '<NO NAME>';
                                $data = $self->reg_query_convert_data($type, 
$data);


Reply via email to