From c2a12fa6579f6394d0411c66a43d38bd3aed8b4b Mon Sep 17 00:00:00 2001 From: jbjohnso Date: Mon, 2 Mar 2009 19:26:21 +0000 Subject: [PATCH] -Have getbmcconfig relay bmcport if set git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@2825 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- xCAT-server/lib/xcat/plugins/bmcconfig.pm | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/xCAT-server/lib/xcat/plugins/bmcconfig.pm b/xCAT-server/lib/xcat/plugins/bmcconfig.pm index f38f24d77..5e766c54d 100644 --- a/xCAT-server/lib/xcat/plugins/bmcconfig.pm +++ b/xCAT-server/lib/xcat/plugins/bmcconfig.pm @@ -109,13 +109,17 @@ sub process_request { if ($tmphash->{value} eq "1" or $tmphash->{value} =~ /y(es)?/i) { $password = genpassword(8); $gennedpassword=1; + $tmphash=$ipmitable->getNodeAttribs($node,['bmc','username']); } else { - $tmphash=$ipmitable->getNodeAttribs($node,['password']); + $tmphash=$ipmitable->getNodeAttribs($node,['bmc','username','bmcport','password']); if ($tmphash->{password}) { $password = $tmphash->{password}; } } - $tmphash=$ipmitable->getNodeAttribs($node,['bmc','username']); + my $bmcport; + if (defined $tmphash->{bmcport}) { + $bmcport = $tmphash->{bmcport}; + } if ($tmphash->{bmc} ) { $bmc=$tmphash->{bmc}; } @@ -129,6 +133,9 @@ sub process_request { } (my $ip,my $mask,my $gw) = net_parms($bmc); my $response={bmcip=>$ip,netmask=>$mask,gateway=>$gw,username=>$username,password=>$password}; + if (defined $bmcport) { + $response->{bmcport}=$bmcport; + } $callback->($response); if ($gennedpassword) { # save generated password $ipmitable->setNodeAttribs($node,{password=>$password});