From 0eef3d18366ea0ad2273487dbf3a961b67fef841 Mon Sep 17 00:00:00 2001 From: yinle Date: Sat, 2 Jul 2011 01:47:50 +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@9998 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- perl-xCAT/xCAT/PPCscan.pm | 31 ++++++++++++++++++++++++++----- 1 file changed, 26 insertions(+), 5 deletions(-) diff --git a/perl-xCAT/xCAT/PPCscan.pm b/perl-xCAT/xCAT/PPCscan.pm index 38f45faa6..fe5ab1fd3 100644 --- a/perl-xCAT/xCAT/PPCscan.pm +++ b/perl-xCAT/xCAT/PPCscan.pm @@ -24,11 +24,20 @@ my @header = ( ["serial-number", "%-15s" ], ["side", "%-6s\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, ); @@ -538,7 +547,9 @@ sub format_stanza { if ( /^node$/ ) { next; } elsif ( /^nodetype$/ ) { - $d = $type; + $d = $globalnodetype{$type}; + } elsif ( /^hwtype$/ ) { + $d = $globalhwtype{$type}; } elsif ( /^groups$/ ) { $d = "$type,all"; } elsif ( /^mgt$/ ) { @@ -554,6 +565,10 @@ sub format_stanza { if ( $type eq "lpar" ) { $d = undef; } + } elsif (/^side$/) { + unless ( $type =~ /^fsp|bpa$/ ) { + next; + } } $result .= "\t$_=$d\n"; } @@ -608,7 +623,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$/ ) { @@ -623,6 +640,10 @@ sub format_xml { if ( $type eq "lpar" ) { $d = undef; } + } elsif (/^side$/) { + unless ( $type =~ /^fsp|bpa$/ ) { + next; + } } $href->{Node}->{$_} = $d; }