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
This commit is contained in:
yinle 2011-07-02 02:35:17 +00:00
parent 40f2a6ca62
commit bf1faf11d9

View File

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