Changed table name from capacity to hwinv.

This commit is contained in:
linggao 2013-12-19 22:39:50 -05:00
parent 06af9c15a1
commit 1e3062d8e4
2 changed files with 14 additions and 14 deletions

View File

@ -1503,10 +1503,10 @@ mic => {
disable => "Do not use. tabprune will not work if set to yes or 1",
},
},
capacity => {
hwinv => {
cols => [qw(node cputype cpucount memory disksize comments disable)],
keys => [qw(node)],
table_desc => 'The basic node capacity.',
table_desc => 'The hareware inventory for the node.',
descriptions => {
node => 'The node name or group name.',
cputype => 'The cpu model name for the node.',
@ -2505,23 +2505,23 @@ my @nodeattrs = (
access_tabentry => 'mic.node=attr:node',
},
#####################
## capacity table #
## hwinv table #
#####################
{attr_name => 'cputype',
tabentry => 'capacity.cputype',
access_tabentry => 'capacity.node=attr:node',
tabentry => 'hwinv.cputype',
access_tabentry => 'hwinv.node=attr:node',
},
{attr_name => 'cpucount',
tabentry => 'capacity.cpucount',
access_tabentry => 'capacity.node=attr:node',
tabentry => 'hwinv.cpucount',
access_tabentry => 'hwinv.node=attr:node',
},
{attr_name => 'memory',
tabentry => 'capacity.memory',
access_tabentry => 'capacity.node=attr:node',
tabentry => 'hwinv.memory',
access_tabentry => 'hwinv.node=attr:node',
},
{attr_name => 'disksize',
tabentry => 'capacity.disksize',
access_tabentry => 'capacity.node=attr:node',
tabentry => 'hwinv.disksize',
access_tabentry => 'hwinv.node=attr:node',
},
); # end of @nodeattrs that applies to both nodes and groups

View File

@ -154,10 +154,10 @@ sub process_request {
}
}
# save basic capacities in the capacity table
# save inventory info into the hwinv table
if (defined($request->{cpucount}) or defined($request->{cputype}) or defined($request->{memory}) or defined($request->{disksize})) {
my $basicdata;
my $cap_tab = xCAT::Table->new("capacity",-create=>1);
my $hwinv_tab = xCAT::Table->new("hwinv",-create=>1);
if ($request->{memory}->[0]) {
$basicdata->{memory} = $request->{memory}->[0];
}
@ -170,7 +170,7 @@ sub process_request {
if ($request->{cputype}->[0]) {
$basicdata->{cputype} = $request->{cputype}->[0];
}
$cap_tab->setNodeAttribs($node, $basicdata);
$hwinv_tab->setNodeAttribs($node, $basicdata);
}