Author: arkurth
Date: Wed Oct 5 13:39:39 2011
New Revision: 1179222
URL: http://svn.apache.org/viewvc?rev=1179222&view=rev
Log:
VCL-524
Fixed bug in Windows.pm::get_network_configuration to prevent it from returning
undefined if it failed to run ipconfig. It is configured to make multiple
attempts. It wasn't detecting bad ipconfig output and was returning undefined
under some circumstances.
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=1179222&r1=1179221&r2=1179222&view=diff
==============================================================================
--- incubator/vcl/trunk/managementnode/lib/VCL/Module/OS/Windows.pm (original)
+++ incubator/vcl/trunk/managementnode/lib/VCL/Module/OS/Windows.pm Wed Oct 5
13:39:39 2011
@@ -5545,16 +5545,18 @@ sub get_network_configuration {
my ($ipconfig_exit_status, $ipconfig_output);
while (++$ipconfig_attempt) {
($ipconfig_exit_status, $ipconfig_output) =
$self->execute($ipconfig_command);
- if (defined($ipconfig_exit_status) && $ipconfig_exit_status ==
0) {
- last;
+ if (!defined($ipconfig_output)) {
+ notify($ERRORS{'WARNING'}, 0, "attempt
$ipconfig_attempt: failed to run the SSH command to run ipconfig");
}
- elsif (defined($ipconfig_exit_status)) {
- notify($ERRORS{'WARNING'}, 0, "attempt
$ipconfig_attempt: failed to run ipconfig, exit status: $ipconfig_exit_status,
output:\n@{$ipconfig_output}");
+ elsif (grep(/Subnet Mask/i, @$ipconfig_output)) {
+ # Make sure output was returned
+ last;
}
else {
- notify($ERRORS{'WARNING'}, 0, "attempt
$ipconfig_attempt: failed to run the SSH command to run ipconfig");
+ notify($ERRORS{'WARNING'}, 0, "attempt
$ipconfig_attempt: failed to run ipconfig, exit status: $ipconfig_exit_status,
output:\n" . join("\n", @$ipconfig_output));
}
+
if ($ipconfig_attempt >= $ipconfig_attempt_limit) {
notify($ERRORS{'WARNING'}, 0, "failed to get network
configuration, made $ipconfig_attempt attempts to run ipconfig");
return;