Author: arkurth
Date: Thu Aug 29 17:04:19 2013
New Revision: 1518709

URL: http://svn.apache.org/r1518709
Log:
VCL-682
Added check to xCAT.pm::_lsdef to ensure that something was returned from lsdef 
command. It was returning an empty hash under some conditions.

Fixed typo in node_status.

Modified:
    vcl/trunk/managementnode/lib/VCL/Module/Provisioning/xCAT.pm

Modified: vcl/trunk/managementnode/lib/VCL/Module/Provisioning/xCAT.pm
URL: 
http://svn.apache.org/viewvc/vcl/trunk/managementnode/lib/VCL/Module/Provisioning/xCAT.pm?rev=1518709&r1=1518708&r2=1518709&view=diff
==============================================================================
--- vcl/trunk/managementnode/lib/VCL/Module/Provisioning/xCAT.pm (original)
+++ vcl/trunk/managementnode/lib/VCL/Module/Provisioning/xCAT.pm Thu Aug 29 
17:04:19 2013
@@ -672,7 +672,7 @@ sub node_status {
        
        # Make sure node.profile is configured
        my $node_profile = $node_info->{profile};
-       if (!$node_info) {
+       if (!$node_profile) {
                notify($ERRORS{'WARNING'}, 0, "unable to determine status of 
$computer_node_name, node.profile is not configured:\n" . 
format_data($node_info));
                return;
        }
@@ -1495,10 +1495,6 @@ sub _lsdef {
                notify($ERRORS{'WARNING'}, 0, "failed to execute lsdef command 
for $computer_node_name");
                return;
        }
-       elsif (grep(/Error:/i, @$output)) {
-               notify($ERRORS{'WARNING'}, 0, "failed to run lsdef for 
$computer_node_name, output:\n" . join("\n", @$output));
-               return;
-       }
        
        # Expected output:
        # Object name: vclh3-4
@@ -1518,6 +1514,12 @@ sub _lsdef {
                        $node_info->{$property} = $value;
                }
        }
+       
+       if (grep(/Error:/i, @$output) || !keys(%$node_info)) {
+               notify($ERRORS{'WARNING'}, 0, "failed to run lsdef for 
$computer_node_name, output:\n" . join("\n", @$output));
+               return;
+       }
+       
        notify($ERRORS{'DEBUG'}, 0, "retrieved xCAT object definition for 
$computer_node_name:\n" . format_data($node_info));
        return $node_info;
 }


Reply via email to