From 61517af5ce01c651706232c9f4f25c607118219e Mon Sep 17 00:00:00 2001 From: mellor Date: Thu, 18 Sep 2014 20:01:37 -0700 Subject: [PATCH] remove the lsslp defined pbmc node from the found nodes --- xCAT-server/lib/perl/xCAT/PPC.pm | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) mode change 100755 => 100644 xCAT-server/lib/perl/xCAT/PPC.pm diff --git a/xCAT-server/lib/perl/xCAT/PPC.pm b/xCAT-server/lib/perl/xCAT/PPC.pm old mode 100755 new mode 100644 index 8a53afdeb..e32ac42c9 --- a/xCAT-server/lib/perl/xCAT/PPC.pm +++ b/xCAT-server/lib/perl/xCAT/PPC.pm @@ -2155,11 +2155,28 @@ sub findme { push @attr_array, "mtm==$request->{mtm}->[0]"; push @attr_array, "serial==$request->{serial}->[0]"; - my @nodes = $vpdtab->getAllAttribsWhere(\@attr_array, 'node'); + my @tmp_nodes = $vpdtab->getAllAttribsWhere(\@attr_array, 'node'); + my @nodes = (); + my %nodes_hash = (); + foreach (@tmp_nodes) { + $nodes_hash{$_->{node}} = '1'; + } + @nodes = keys (%nodes_hash); + # remove the pbmc node defined by lsslp from the node groups + my $ppctab = xCAT::Table->new('ppc'); + if ($ppctab) { + my $ppchash = $ppctab->getNodesAttribs(\@nodes, ['node', 'nodetype']); + foreach (@nodes) { + if (defined($ppchash->{$_}->[0]) && defined($ppchash->{$_}->[0]->{'nodetype'}) && $ppchash->{$_}->[0]->{'nodetype'} eq 'pbmc') { + delete $nodes_hash{$_}; + } + } + @nodes = keys (%nodes_hash); + } foreach (@nodes) { my $req = {%$request}; $req->{command} = ['discovered']; - $req->{noderange} = [$_->{node}]; + $req->{noderange} = [$_]; $req->{discoverymethod} = ['mtms']; $subreq->($req); %{$req} = ();