delete username HMC from usage page of rspconfig
git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@12231 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
This commit is contained in:
parent
77d99a07e2
commit
24ac5b5ecf
@ -114,7 +114,6 @@ my %usage = (
|
||||
rspconfig <singlenode> [textid=name]
|
||||
rspconfig <singlenode> [frame=number]
|
||||
rspconfig <singlenode> [USERID=passwd]
|
||||
rspconfig <singlenode> [HMC=passwd]
|
||||
rspconfig <noderange> [sshcfg=<enable|disable>|
|
||||
snmpcfg=<enable|disable>|
|
||||
pd1=<nonred|redwoperf|redwperf>|
|
||||
|
@ -53,15 +53,18 @@ sub new {
|
||||
if ($nokeycheck) { delete $args{"-nokeycheck"}; }
|
||||
my $self = Net::Telnet->new(%args);
|
||||
_startssh($self,$pty,$username,$host,"-nokeycheck"=>$nokeycheck);
|
||||
$self->waitfor("-match" => '/password:/i', -errmode => "return") or die "Unable to reach host ",$self->lastline;
|
||||
$self->print($password);
|
||||
my $nextline = $self->getline();
|
||||
if ($nextline eq "\n") {
|
||||
my ($prematch,$match) = $self->waitfor([Match => $args{prompt},'/password:/i',]);
|
||||
if ($match =~ /password:/i) {
|
||||
#$self->waitfor("-match" => '/password:/i', -errmode => "return") or die "Unable to reach host ",$self->lastline;
|
||||
$self->print($password);
|
||||
my $nextline = $self->getline();
|
||||
if ($nextline eq "\n") {
|
||||
$nextline = $self->get();
|
||||
}
|
||||
if ($nextline =~ /^password:/ or $nextline =~ /Permission denieid, please try again/) {
|
||||
die "Incorrect Password";
|
||||
}
|
||||
}
|
||||
if ($nextline =~ /^password:/ or $nextline =~ /Permission denieid, please try again/) {
|
||||
die "Incorrect Password";
|
||||
}
|
||||
}
|
||||
return bless($self,$class);
|
||||
}
|
||||
1;
|
||||
|
@ -3978,17 +3978,17 @@ sub clicmds {
|
||||
my @unhandled;
|
||||
my %handled = ();
|
||||
my $result;
|
||||
my @tcmds = qw(snmpcfg sshcfg network swnet pd1 pd2 textid network_reset rscanfsp initnetwork solcfg userpassword USERID HMC);
|
||||
my @tcmds = qw(snmpcfg sshcfg network swnet pd1 pd2 textid network_reset rscanfsp initnetwork solcfg userpassword USERID);
|
||||
|
||||
# most of these commands should be able to be done
|
||||
# through SNMP, but they produce various errors.
|
||||
foreach my $cmd (@{$args{cmds}}) {
|
||||
if ($cmd =~ /^swnet|pd1|pd2|sshcfg|rscanfsp|USERID|HMC|=/) {
|
||||
foreach my $cmd (@{$args{args}}) {
|
||||
if ($cmd =~ /^swnet|pd1|pd2|sshcfg|rscanfsp|USERID|userpassword|=/) {
|
||||
if (($cmd =~ /^textid/) and ($nodeid > 0)) {
|
||||
push @unhandled,$cmd;
|
||||
next;
|
||||
}
|
||||
my ($command,$value) = split /=/,$cmd;
|
||||
my ($command,$value) = split /=/,$cmd,2;
|
||||
|
||||
#$command =~ /^swnet/) allows for swnet1, swnet2, etc.
|
||||
if (grep(/^$command$/,@tcmds) || $command =~ /^swnet/) {
|
||||
@ -4099,7 +4099,7 @@ sub clicmds {
|
||||
elsif (/^rscanfsp$/) { $result = rscanfsp($t,$mpa,$handled{$_},$mm); }
|
||||
elsif (/^solcfg$/) { $result = solcfg($t,$handled{$_},$mm); }
|
||||
elsif (/^network_reset$/) { $result = network($t,$handled{$_},$mpa,$mm,$node,$nodeid,1); $reset=1; }
|
||||
elsif (/^(USERID|HMC)$/) {$result = passwd($t, $mpa, $1, "=".$handled{$_}, $mm);}
|
||||
elsif (/^(USERID)$/) {$result = passwd($t, $mpa, $1, "=".$handled{$_}, $mm);}
|
||||
elsif (/^userpassword$/) {$result = passwd($t, $mpa, $1, $handled{$_}, $mm);}
|
||||
push @data, "$_: @$result";
|
||||
$Rc |= shift(@$result);
|
||||
@ -4303,8 +4303,19 @@ sub passwd {
|
||||
if (!grep(/OK/i, @data)) {
|
||||
return ([1, @data]);
|
||||
}
|
||||
if ($user eq "HMC") {
|
||||
$mpatab->setAttribs({mpa=>$mpa,username=>$user},{password=>$pass});
|
||||
@data = ();
|
||||
my $snmp_cmd = "users -n $user -ap sha -pp des -ppw $pass -t system:$mm";
|
||||
@data = $t->cmd($snmp_cmd);
|
||||
if (!grep(/ok/i, @data)) {
|
||||
$cmd = "users -n $user -op $pass -p $oldpass -T system:$mm";
|
||||
my @back_pwd = $t->cmd($cmd);
|
||||
if (!grep(/OK/i, @back_pwd)) {
|
||||
$mpatab->setAttribs({mpa=>$mpa,username=>$user},{password=>$pass});
|
||||
}
|
||||
return ([1, @data]);
|
||||
}
|
||||
$mpatab->setAttribs({mpa=>$mpa,username=>$user},{password=>$pass});
|
||||
if ($user eq "USERID") {
|
||||
my $fsp_api = ($::XCATROOT) ? "$::XCATROOT/sbin/fsp-api" : "/opt/xcat/sbin/fsp-api";
|
||||
my $blades = &get_blades_for_mpa($mpa);
|
||||
if (!defined($blades)) {
|
||||
@ -4337,13 +4348,6 @@ sub passwd {
|
||||
} else {
|
||||
#TODO: add new user if name mismatches what MM alread understands..
|
||||
#additionally, may have to delete USERID in this event
|
||||
@data = ();
|
||||
my $snmp_cmd = "users -n $user -ap sha -pp des -ppw $pass -T system:$mm";
|
||||
@data = $t->cmd($snmp_cmd);
|
||||
if (!grep(/OK/i, @data)) {
|
||||
return ([1, @data]);
|
||||
}
|
||||
$mpatab->setAttribs({mpa=>$mpa,username=>$user},{password=>$pass});
|
||||
}
|
||||
} else {
|
||||
return ([1, "Update password for $user in 'mpa' table failed"]);
|
||||
|
Loading…
Reference in New Issue
Block a user