From 74db2d9120b3f0d1327a1093cf528bc8c982ca1b Mon Sep 17 00:00:00 2001 From: zhaoertao Date: Mon, 11 Mar 2013 01:57:06 +0000 Subject: [PATCH] snyc from trunk git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/branches/2.8@15445 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- perl-xCAT/xCAT/FSPvitals.pm | 3 +++ xCAT-server/lib/xcat/plugins/blade.pm | 9 ++++----- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/perl-xCAT/xCAT/FSPvitals.pm b/perl-xCAT/xCAT/FSPvitals.pm index 1cb36bac6..6915f26ae 100644 --- a/perl-xCAT/xCAT/FSPvitals.pm +++ b/perl-xCAT/xCAT/FSPvitals.pm @@ -116,6 +116,9 @@ sub enumerate_lcds { } else { my @array = split(/\n/, $data); foreach my $a (@array) { + if ($a !~ /:\s?[^\s]*\s?[0|1]/) { + next; + } my @t = split(/:/, $a); my $name = $t[0]; $data = $t[1]; diff --git a/xCAT-server/lib/xcat/plugins/blade.pm b/xCAT-server/lib/xcat/plugins/blade.pm index 22e7e2b76..c4a01ab16 100644 --- a/xCAT-server/lib/xcat/plugins/blade.pm +++ b/xCAT-server/lib/xcat/plugins/blade.pm @@ -4561,11 +4561,11 @@ sub get_blades_for_mpa { my %blades_hash = (); my $mptab = xCAT::Table->new('mp'); my $ppctab = xCAT::Table->new('ppc'); - my @attribs = qw(id pprofile parent hcp); + my @attribs = qw(id nodetype parent hcp); if (!defined($mptab) or !defined($ppctab)) { return undef; } - my @nodearray = $mptab->getAttribs({mpa=>$mpa,nodetype=>"blade"}, qw(node)); + my @nodearray = $mptab->getAttribs({mpa=>$mpa}, qw(node)); my @blades = (); my $nodesattrs; if (!(@nodearray)) { @@ -4583,12 +4583,11 @@ sub get_blades_for_mpa { my $att = $nodesattrs->{$node}->[0]; if (!defined($att)) { next; - } elsif ($att and $att->{parent} and ($att->{parent} ne $mpa)) { + } elsif (!defined($att->{parent}) or ($att->{parent} ne $mpa) or !defined($att->{nodetype}) or ($att->{nodetype} ne "blade")) { next; } my $request; - my $nodetype = "blade"; - my $hcp_ip = xCAT::FSPUtils::getIPaddress($request, $nodetype, $att->{hcp}); + my $hcp_ip = xCAT::FSPUtils::getIPaddress($request, $att->{nodetype}, $att->{hcp}); if (!defined($hcp_ip) or ($hcp_ip == -3)) { next; }