diff --git a/perl-xCAT-2.0/xCAT/PPCdb.pm b/perl-xCAT-2.0/xCAT/PPCdb.pm index e85a52318..1da8a669b 100644 --- a/perl-xCAT-2.0/xCAT/PPCdb.pm +++ b/perl-xCAT-2.0/xCAT/PPCdb.pm @@ -40,6 +40,23 @@ sub add_ppc { $parent, $ips ) = split /,/; + ############################### + # Update nodetype table + ############################### + if ( $type =~ /^fsp|bpa|lpar|hmc|ivm$/ ) { + my ($k,$u); + my %nodetype = ( + fsp => $::NODETYPE_FSP, + bpa => $::NODETYPE_BPA, + lpar =>"$::NODETYPE_LPAR,$::NODETYPE_OSI", + hmc => $::NODETYPE_HMC, + ivm => $::NODETYPE_IVM, + ); + $k->{node} = $name; + $u->{nodetype} = $nodetype{$type}; + $db{nodetype}->setAttribs( $k,$u ); + $db{nodetype}{commit} = 1; + } ############################### # Update ppc table ############################### @@ -62,27 +79,13 @@ sub add_ppc { $db{nodelist}->setAttribs( $k1,$u1 ); $db{nodelist}{commit} = 1; - ########################### - # Update nodetype table - ########################### - my ($k2,$u2); - my %nodetype = ( - fsp => $::NODETYPE_FSP, - bpa => $::NODETYPE_BPA, - lpar =>"$::NODETYPE_LPAR,$::NODETYPE_OSI" - ); - $k2->{node} = $name; - $u2->{nodetype} = $nodetype{$type}; - $db{nodetype}->setAttribs( $k2,$u2 ); - $db{nodetype}{commit} = 1; - ########################### # Update nodehm table ########################### - my ($k3,$u3); - $k3->{node} = $name; - $u3->{mgt} = $hwtype; - $db{nodehm}->setAttribs( $k3,$u3 ); + my ($k2,$u2); + $k2->{node} = $name; + $u2->{mgt} = $hwtype; + $db{nodehm}->setAttribs( $k2,$u2 ); $db{nodehm}{commit} = 1; } ############################### @@ -286,3 +289,4 @@ sub credentials { +