Author: arkurth
Date: Thu Aug 13 14:05:53 2009
New Revision: 803892
URL: http://svn.apache.org/viewvc?rev=803892&view=rev
Log:
VCL-187
Updated Ubuntu.pm::delete_user(). Added call to retrieve management node's
identity keys and this is used for SSH calls. Changed calls to use
$user_login_id variable.
Modified:
incubator/vcl/trunk/managementnode/lib/VCL/Module/OS/Linux/Ubuntu.pm
Modified: incubator/vcl/trunk/managementnode/lib/VCL/Module/OS/Linux/Ubuntu.pm
URL:
http://svn.apache.org/viewvc/incubator/vcl/trunk/managementnode/lib/VCL/Module/OS/Linux/Ubuntu.pm?rev=803892&r1=803891&r2=803892&view=diff
==============================================================================
--- incubator/vcl/trunk/managementnode/lib/VCL/Module/OS/Linux/Ubuntu.pm
(original)
+++ incubator/vcl/trunk/managementnode/lib/VCL/Module/OS/Linux/Ubuntu.pm Thu
Aug 13 14:05:53 2009
@@ -199,6 +199,7 @@
}
my $imagemeta_rootaccess = $self->data->get_imagemeta_rootaccess();
+ my $management_node_keys = $self->data->get_management_node_keys();
# Use userdel to delete the user
my $user_delete_command = "/usr/sbin/userdel $user_login_id";
@@ -212,23 +213,23 @@
#Clear user from external_sshd_config
my $clear_extsshd = "sed -ie \"/^AllowUsers .*/d\"
/etc/ssh/external_sshd_config";
- if (run_ssh_command($computer_node_name, $identity, $clear_extsshd,
"root")) {
+ if (run_ssh_command($computer_node_name, $management_node_keys,
$clear_extsshd, "root")) {
notify($ERRORS{'DEBUG'}, 0, "cleared AllowUsers directive from
external_sshd_config");
}
else {
- notify($ERRORS{'CRITICAL'}, 0, "failed to add AllowUsers $user
to external_sshd_config");
+ notify($ERRORS{'CRITICAL'}, 0, "failed to add AllowUsers
$user_login_id to external_sshd_config");
}
#Clear user from sudoers
if ($imagemeta_rootaccess) {
#clear user from sudoers file
- my $clear_cmd = "sed -ie \"/^$user_name .*/d\" /etc/sudoers";
- if (run_ssh_command($computer_node_name, $image_identity,
$clear_cmd, "root")) {
- notify($ERRORS{'DEBUG'}, 0, "cleared $user_name from
/etc/sudoers");
+ my $clear_cmd = "sed -ie \"/^$user_login_id .*/d\"
/etc/sudoers";
+ if (run_ssh_command($computer_node_name, $management_node_keys,
$clear_cmd, "root")) {
+ notify($ERRORS{'DEBUG'}, 0, "cleared $user_login_id
from /etc/sudoers");
}
else {
- notify($ERRORS{'CRITICAL'}, 0, "failed to clear
$user_name from /etc/sudoers");
+ notify($ERRORS{'CRITICAL'}, 0, "failed to clear
$user_login_id from /etc/sudoers");
}
} ## end if ($imagemeta_rootaccess)