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/09 23:19:16 UTC
svn commit: r783142 -
/incubator/vcl/trunk/managementnode/lib/VCL/Module/OS/Windows_mod.pm
Author: arkurth
Date: Tue Jun 9 21:19:10 2009
New Revision: 783142
URL: http://svn.apache.org/viewvc?rev=783142&view=rev
Log:
VCL-23
Fixed bug in Windows_mod.pm::set_password(). It wasn't properly checking if the SSH command failed entirely.
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=783142&r1=783141&r2=783142&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 Tue Jun 9 21:19:10 2009
@@ -1586,10 +1586,14 @@
if ($set_password_exit_status == 0) {
notify($ERRORS{'OK'}, 0, "password changed to '$password' for user '$username' on $computer_node_name");
}
- else {
+ elsif (defined $set_password_exit_status) {
notify($ERRORS{'WARNING'}, 0, "failed to change password to '$password' for user '$username' on $computer_node_name, exit status: $set_password_exit_status, output:\n@{$set_password_output}");
return 0;
}
+ else {
+ notify($ERRORS{'WARNING'}, 0, "failed to run ssh command to change password to '$password' for user '$username' on $computer_node_name");
+ return 0;
+ }
# Check if root user, must set sshd service password too
if ($username eq 'root') {
@@ -1606,10 +1610,14 @@
if (defined($schtasks_query_exit_status) && $schtasks_query_exit_status == 0) {
notify($ERRORS{'DEBUG'}, 0, "queried scheduled tasks on $computer_node_name");
}
- else {
+ elsif (defined $schtasks_query_exit_status) {
notify($ERRORS{'WARNING'}, 0, "failed to query scheduled tasks on $computer_node_name, exit status: $schtasks_query_exit_status, output:\n@{$schtasks_query_output}");
return 0;
}
+ else {
+ notify($ERRORS{'WARNING'}, 0, "failed to run ssh command to query scheduled tasks on $computer_node_name");
+ return 0;
+ }
# Find scheduled tasks configured to run as this user
my $task_name;
@@ -1630,10 +1638,14 @@
if (defined($schtasks_change_exit_status) && $schtasks_change_exit_status == 0) {
notify($ERRORS{'OK'}, 0, "changed password for scheduled task: $task_name_to_update");
}
- else {
+ elsif (defined $schtasks_change_exit_status) {
notify($ERRORS{'WARNING'}, 0, "failed to change password for scheduled task: $task_name_to_update, exit status: $schtasks_change_exit_status, output:\n@{$schtasks_change_output}");
return 0;
}
+ else {
+ notify($ERRORS{'WARNING'}, 0, "failed to run ssh command to change password for scheduled task: $task_name_to_update");
+ return 0;
+ }
} ## end for my $task_name_to_update (@task_names_to_update)
return 1;