merge qing's fix from 2.8.2-pcm to 2.8-pcm

This commit is contained in:
yinqing
2013-11-11 17:56:01 +08:00
parent 8f920c6a2c
commit 08683a45d6
4 changed files with 40 additions and 4 deletions

View File

@ -541,6 +541,32 @@ sub get_allnode_singleattrib_hash
return \%allrecords;
}
#-------------------------------------------------------------------------------
=head3 get_db_swtiches
Description : Get all records of switch config from a table, then return a string list.
Arguments : $tabname - the table name.
Returns : Reference of the records hash.
=cut
#-------------------------------------------------------------------------------
sub get_db_switches
{
my $class = shift;
my $table = xCAT::Table->new("switches");
my @attribs = ("switch");
my @entries = $table->getAllAttribs(@attribs);
$table->close();
my %allrecords;
foreach (@entries)
{
if ($_->{'switch'}){
$allrecords{$_->{'switch'}} = 0;
}
}
return \%allrecords;
}
#-------------------------------------------------------------------------------
=head3 get_db_swtichports
@ -556,6 +582,7 @@ sub get_db_switchports
my $table = xCAT::Table->new("switch");
my @attribs = ("switch", "port");
my @entries = $table->getAllAttribs(@attribs);
$table->close();
my %allrecords;
foreach (@entries)
{

View File

@ -171,8 +171,12 @@ sub process_request {
# Do the check
my $imageprofile = parse_str_arg($request->{arg}->[0]);
my $kitdata = $request->{kitdata};
if (! defined($kitdata) && !($command eq "kitimagepostdelete")) {
my $kitdata = undef;
if(exists($request->{kitdata}))
{
$kitdata = $request->{kitdata};
}
if (! defined($kitdata) && ! ($command eq 'kitimagepostdelete')) {
$kitdata = xCAT::KitPluginUtils->get_kits_used_by_image_profiles([$imageprofile]);
$request->{kitdata} = $kitdata;
}

View File

@ -521,13 +521,18 @@ sub nextdestiny {
my %requ;
$requ{node}=[$node];
$requ{arg}=[$ref->{currstate}];
if($ref->{currstate} =~ /noupdateinitrd$/)
{
my @items = split /[:]/,$ref->{currstate};
$requ{arg}= \@items;
}
setdestiny(\%requ, $flag+1);
}
if ($callnodeset) {
$subreq->({command=>['nodeset'],
node=> \@nodes,
arg=>['enact']});
arg=>['enact', '--noupdateinitrd']});
}
}

View File

@ -332,7 +332,7 @@ Usage:
my %allfspips = %$recordsref;
# Get all switches name
$recordsref = xCAT::ProfiledNodeUtils->get_allnode_singleattrib_hash('switches', 'switch');
$recordsref = xCAT::ProfiledNodeUtils->get_db_switches();
%allswitches = %$recordsref;
# Get all switches_switchport