From bf1faf11d9596fbdf722d76023553fe565d9b867 Mon Sep 17 00:00:00 2001 From: yinle Date: Sat, 2 Jul 2011 02:35:17 +0000 Subject: [PATCH] Fix bug 3346280: rcons can't work with the lpar node git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@10000 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- perl-xCAT/xCAT/FSPscan.pm | 31 ++++++++++++++++++++++++++----- 1 file changed, 26 insertions(+), 5 deletions(-) diff --git a/perl-xCAT/xCAT/FSPscan.pm b/perl-xCAT/xCAT/FSPscan.pm index 672ad65bc..f3496c698 100644 --- a/perl-xCAT/xCAT/FSPscan.pm +++ b/perl-xCAT/xCAT/FSPscan.pm @@ -27,11 +27,20 @@ my @header = ( ["side", "%-8s" ], ["address", "%-20s\n" ]); -my @attribs = qw(nodetype node id mtm serial side hcp pprofile parent groups mgt cons); -my %nodetype = ( +my @attribs = qw(nodetype hwtype node id mtm serial side hcp pprofile parent groups mgt cons); +my %globalnodetype = ( + fsp => $::NODETYPE_PPC, + bpa => $::NODETYPE_PPC, + cec => $::NODETYPE_PPC, + frame=> $::NODETYPE_PPC, + lpar =>"$::NODETYPE_PPC,$::NODETYPE_OSI" +); +my %globalhwtype = ( fsp => $::NODETYPE_FSP, bpa => $::NODETYPE_BPA, - lpar =>"$::NODETYPE_LPAR,$::NODETYPE_OSI" + lpar => $::NODETYPE_LPAR, + cec => $::NODETYPE_CEC, + frame=> $::NODETYPE_FRAME, ); @@ -384,7 +393,9 @@ sub format_stanza { if ( /^node$/ ) { next; } elsif ( /^nodetype$/ ) { - $d = $nodetype{$d}; + $d = $globalnodetype{$type}; + } elsif ( /^hwtype$/ ) { + $d = $globalhwtype{$type}; } elsif ( /^groups$/ ) { $d = "$type,all"; } elsif ( /^mgt$/ ) { @@ -400,6 +411,10 @@ sub format_stanza { if ( $type eq "lpar" ) { $d = undef; } + } elsif (/^side$/) { + unless ( $type =~ /^fsp|bpa$/ ) { + next; + } } $result .= "\t$_=$d\n"; } @@ -449,7 +464,9 @@ sub format_xml { my $d = $data[$i++]; if ( /^nodetype$/ ) { - $d = $nodetype{$d}; + $d = $globalnodetype{$type}; + } elsif ( /^hwtype$/ ) { + $d = $globalhwtype{$type}; } elsif ( /^groups$/ ) { $d = "$type,all"; } elsif ( /^mgt$/ ) { @@ -464,6 +481,10 @@ sub format_xml { if ( $type eq "lpar" ) { $d = undef; } + } elsif (/^side$/) { + unless ( $type =~ /^fsp|bpa$/ ) { + next; + } } $href->{Node}->{$_} = $d; }