From 25fae0de1980dd0b0b1f074b55ab10e69ba04739 Mon Sep 17 00:00:00 2001 From: sakolish Date: Tue, 3 Jun 2008 19:10:38 +0000 Subject: [PATCH] Modified telnetcmd() function to allow lsslp to call it to configure MMs after discovery git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@1572 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- xCAT-server/lib/xcat/plugins/blade.pm | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/xCAT-server/lib/xcat/plugins/blade.pm b/xCAT-server/lib/xcat/plugins/blade.pm index 45a8d774d..bed6eea3a 100644 --- a/xCAT-server/lib/xcat/plugins/blade.pm +++ b/xCAT-server/lib/xcat/plugins/blade.pm @@ -1648,7 +1648,7 @@ sub telnetcmds { my @unhandled; my %handled = (); my $result; - my @tcmds = qw(snmpcfg sshcfg network swnet pd1 pd2 textid); + my @tcmds = qw(snmpcfg sshcfg network swnet pd1 pd2 textid network_reset); # most of these commands should be able to be done # through SNMP, but they produce various errors. @@ -1680,9 +1680,10 @@ sub telnetcmds { } if (!$Rc) { push @cfgtext,$t->errmsg; - return([1,\@unhandled]); + return([1,\@unhandled,$t->errmsg]); } $Rc = 0; + my @data; foreach (keys %handled) { if (/^snmpcfg/) { $result = snmpcfg($t,$handled{$_},$user,$pass); } @@ -1691,11 +1692,13 @@ sub telnetcmds { elsif (/^swnet$/) { $result = swnet($t,$handled{$_}); } elsif (/^pd1|pd2$/) { $result = pd($t,$_,$handled{$_}); } elsif (/^textid$/) { $result = mmtextid($t,$mpa,$handled{$_}); } + elsif (/^network_reset$/) { $result = network($t,$handled{$_},$mpa,1); } + push @data, "$_: @$result"; $Rc |= shift(@$result); push @cfgtext,@$result; } $t->close; - return([$Rc,\@unhandled]); + return([$Rc,\@unhandled,\@data]); } @@ -1745,6 +1748,7 @@ sub network { my $t = shift; my $value = shift; my $mpa = shift; + my $reset = shift; my $cmd = "ifconfig -eth0 -c static -r auto -d auto -m 1500 -T system:mm[1]"; my ($ip,$host,$gateway,$mask); @@ -1797,6 +1801,10 @@ sub network { if ($host) { push @result,"MM Hostname: $host"; } if ($gateway){ push @result,"Gateway: $gateway"; } if ($mask) { push @result,"Subnet Mask: $mask"; } + + if (defined($reset)) { + $t->cmd("reset -T system:mm[1]"); + } return([0,@result]); } @@ -2149,3 +2157,4 @@ sub dompa { +