Changed xCAT database ppc.profile to ppc.pprofile (power-on profile)

git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@856 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
This commit is contained in:
sakolish 2008-03-20 18:32:18 +00:00
parent b7e516b8ca
commit 34213a12dc
6 changed files with 70 additions and 58 deletions

View File

@ -436,7 +436,7 @@ sub resolve {
my $request = shift;
my $node = shift;
my $tabs = shift;
my @attribs = qw(id profile parent hcp);
my @attribs = qw(id pprofile parent hcp);
my @values = ();
#################################
@ -516,22 +516,22 @@ sub resolve {
# Optional and N/A fields
#################################
elsif ( $type =~ /^$::NODETYPE_FSP$/ ) {
$att->{profile} = 0;
$att->{id} = 0;
$att->{fsp} = 0;
$att->{node} = $node;
$att->{type} = $type;
$att->{parent} = exists($att->{parent}) ? $att->{parent} : 0;
$att->{bpa} = $att->{parent};
$att->{pprofile} = 0;
$att->{id} = 0;
$att->{fsp} = 0;
$att->{node} = $node;
$att->{type} = $type;
$att->{parent} = exists($att->{parent}) ? $att->{parent} : 0;
$att->{bpa} = $att->{parent};
}
elsif ( $type =~ /^$::NODETYPE_BPA$/ ) {
$att->{profile} = 0;
$att->{id} = 0;
$att->{bpa} = 0;
$att->{parent} = 0;
$att->{fsp} = 0;
$att->{node} = $node;
$att->{type} = $type;
$att->{pprofile} = 0;
$att->{id} = 0;
$att->{bpa} = 0;
$att->{parent} = 0;
$att->{fsp} = 0;
$att->{node} = $node;
$att->{type} = $type;
}
#################################
# Find MTMS in vpd database
@ -563,7 +563,7 @@ sub resolve {
#################################
# Build array of data
#################################
foreach ( qw(id profile fsp hcp type bpa) ) {
foreach ( qw(id pprofile fsp hcp type bpa) ) {
push @values, $att->{$_};
}
return( \@values );
@ -847,3 +847,4 @@ sub process_request {

View File

@ -100,10 +100,10 @@ sub ivm_rnetboot {
#######################################
# Get node data
#######################################
my $id = @$d[0];
my $profile = @$d[1];
my $fsp = @$d[2];
my $hcp = @$d[3];
my $id = @$d[0];
my $pprofile = @$d[1];
my $fsp = @$d[2];
my $hcp = @$d[3];
#######################################
# Find Expect script
@ -144,7 +144,7 @@ sub ivm_rnetboot {
#######################################
# Add command options
#######################################
$cmd.= " -t ent -f \"$name\" \"$profile\" \"$fsp\" $id $hcp $fname";
$cmd.= " -t ent -f \"$name\" \"$pprofile\" \"$fsp\" $id $hcp $fname";
#######################################
# Execute command
@ -338,3 +338,4 @@ sub rnetboot {

View File

@ -36,7 +36,7 @@ sub add_ppc {
$model,
$serial,
$server,
$profile,
$pprofile,
$parent,
$ips ) = split /,/;
@ -45,11 +45,11 @@ sub add_ppc {
###############################
if ( $type =~ /^fsp|bpa|lpar$/ ) {
my ($k,$u);
$k->{node} = $name;
$u->{hcp} = $server;
$u->{id} = $id;
$u->{profile} = $profile;
$u->{parent} = $parent;
$k->{node} = $name;
$u->{hcp} = $server;
$u->{id} = $id;
$u->{pprofile} = $pprofile;
$u->{parent} = $parent;
$db{ppc}->setAttribs( $k, $u );
$db{ppc}{commit} = 1;
@ -62,27 +62,27 @@ sub add_ppc {
$db{nodelist}->setAttribs( $k1,$u1 );
$db{nodelist}{commit} = 1;
###########################
###########################
# Update nodetype table
###########################
my ($k3,$u3);
my %nodetype = (
my ($k2,$u2);
my %nodetype = (
fsp => $::NODETYPE_FSP,
bpa => $::NODETYPE_BPA,
lpar =>"$::NODETYPE_LPAR,$::NODETYPE_OSI"
);
$k3->{node} = $name;
$u3->{nodetype} = $nodetype{$type};
$db{nodetype}->setAttribs( $k3,$u3 );
$k2->{node} = $name;
$u2->{nodetype} = $nodetype{$type};
$db{nodetype}->setAttribs( $k2,$u2 );
$db{nodetype}{commit} = 1;
###########################
# Update nodehm table
###########################
my ($k2,$u2);
$k2->{node} = $name;
$u2->{mgt} = $hwtype;
$db{nodehm}->setAttribs( $k2,$u2 );
my ($k3,$u3);
$k3->{node} = $name;
$u3->{mgt} = $hwtype;
$db{nodehm}->setAttribs( $k3,$u3 );
$db{nodehm}{commit} = 1;
}
###############################
@ -285,3 +285,4 @@ sub credentials {

View File

@ -136,18 +136,14 @@ sub validate_ip {
##########################################################################
sub ivm_getmacs {
my $request = shift;
my $d = shift;
my $exp = shift;
my $name = shift;
my $opt = $request->{opt};
my $id = @$d[0];
my $profile = @$d[1];
my $fsp = @$d[2];
my $hcp = @$d[3];
my $ssh = @$exp[0];
my $userid = @$exp[4];
my $pw = @$exp[5];
my $request = shift;
my $d = shift;
my $exp = shift;
my $name = shift;
my $opt = $request->{opt};
my $ssh = @$exp[0];
my $userid = @$exp[4];
my $pw = @$exp[5];
my $cmd;
my $result;
@ -156,6 +152,14 @@ sub ivm_getmacs {
#######################################
xCAT::PPCcli::disconnect( $exp );
#######################################
# Get node data
#######################################
my $id = @$d[0];
my $pprofile = @$d[1];
my $fsp = @$d[2];
my $hcp = @$d[3];
#######################################
# Find Expect script
#######################################
@ -202,7 +206,7 @@ sub ivm_getmacs {
#######################################
# Add command options
#######################################
$cmd.= " -t ent -f -M -A -n \"$name\" \"$profile\" \"$fsp\" $id $hcp $fname";
$cmd.= " -t ent -f -M -A -n \"$name\" \"$pprofile\" \"$fsp\" $id $hcp $fname";
#######################################
# Execute command
@ -414,3 +418,6 @@ sub writemac {

View File

@ -21,7 +21,7 @@ my @header = (
["serial-number", "%-15s" ],
["address", "%s\n" ]);
my @attribs = qw(nodetype node id model serial hcp profile parent groups mgt);
my @attribs = qw(nodetype node id model serial hcp pprofile parent groups mgt);
my %nodetype = (
fsp => $::NODETYPE_FSP,
bpa => $::NODETYPE_BPA,
@ -599,3 +599,4 @@ sub rscan {

View File

@ -725,7 +725,7 @@ sub list {
my $lparid = @$d[0];
my $mtms = @$d[2];
my $type = @$d[4];
my $profile;
my $pprofile;
####################################
# Must be CEC or LPAR
@ -792,9 +792,9 @@ sub list {
#################################
# List LPAR profile
#################################
$profile .= "@$prof[0]\n\n";
$pprofile .= "@$prof[0]\n\n";
}
push @values, [$lpar, $profile, SUCCESS];
push @values, [$lpar, $pprofile, SUCCESS];
}
}
return( \@values );
@ -966,9 +966,9 @@ sub xCATdB {
#######################################
else {
my ($model,$serial) = split /\*/,@$d[2];
my $profile = $name;
my $server = @$d[3];
my $fsp = @$d[2];
my $pprofile = $name;
my $server = @$d[3];
my $fsp = @$d[2];
###################################
# Find FSP name in ppc database
@ -1002,7 +1002,7 @@ sub xCATdB {
$model,
$serial,
$server,
$profile,
$pprofile,
$ent->{parent} );
return( xCAT::PPCdb::add_ppc( $hwtype, [$values] ));
@ -1046,3 +1046,4 @@ sub lsvm {
1;