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; }