From ce1e7d6bc5d2f553b4c744d5b4e64fc183323ada Mon Sep 17 00:00:00 2001 From: jbjohnso Date: Fri, 2 May 2008 01:59:50 +0000 Subject: [PATCH] -Also accept setting of nodehm.serialport as an implicit hint that serial console should work git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@1247 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- xCAT-server-2.0/lib/xcat/plugins/conserver.pm | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/xCAT-server-2.0/lib/xcat/plugins/conserver.pm b/xCAT-server-2.0/lib/xcat/plugins/conserver.pm index 30f6a0ac6..88f3d06bd 100644 --- a/xCAT-server-2.0/lib/xcat/plugins/conserver.pm +++ b/xCAT-server-2.0/lib/xcat/plugins/conserver.pm @@ -89,17 +89,17 @@ sub preprocess_request { if ($noderange && @$noderange>0) { $allnodes=0; foreach my $node (@$noderange) { - my $ent=$hmtab->getNodeAttribs($node,['node', 'cons', 'conserver']); + my $ent=$hmtab->getNodeAttribs($node,['node', 'serialport','cons', 'conserver']); push @items,$ent; } } else { $allnodes=1; - @items = $hmtab->getAllNodeAttribs(['node', 'cons', 'conserver']); + @items = $hmtab->getAllNodeAttribs(['node', 'serialport','cons', 'conserver']); } my @nodes=(); foreach (@items) { - if ((!defined($_->{cons})) || ($_->{cons} eq "")) { next;} #skip if 'cons' is not defined for this node + if (((!defined($_->{cons})) || ($_->{cons} eq "")) and !defined($_->{serialport})) { next;} #skip if 'cons' is not defined for this node, unless serialport suggests otherwise if (defined($_->{conserver})) { push @{$cons_hash{$_->{conserver}}{nodes}}, $_->{node};} else { push @{$cons_hash{$master}{nodes}}, $_->{node};} push @nodes,$_->{node}; @@ -212,17 +212,18 @@ sub makeconservercf { #print "process_request nodes=@$nodes\n"; my $hmtab = xCAT::Table->new('nodehm'); - my @cfgents1 = $hmtab->getAllNodeAttribs(['cons','conserver']); + my @cfgents1 = $hmtab->getAllNodeAttribs(['cons','serialport','mgt','conserver']); #cfgents should now have all the nodes, so we can fill in our hashes one at a time. - # skip the one that does not have 'cons' defined + # skip the one that does not have 'cons' defined, unless a serialport setting suggests otherwise my @cfgents=(); - foreach (@cfgents1) { - if ($_->{cons}) { push @cfgents, $_; } + foreach (@cfgents1) { + if ($_->{cons} or defined($_->{'serialport'}) { push @cfgents, $_; } } # get the teminal servers and terminal port when cons is mrv or cyclades foreach (@cfgents) { + unless ($_->{cons}) {$_->{cons} = $_->{mgt};} #populate with fallback my $cmeth=$_->{cons}; if (grep(/^$cmeth$/,@cservers)) { #terminal server, more attribs needed my $node = $_->{node};