Commit 08683a45 authored by yinqing's avatar yinqing
Browse files

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

parent 8f920c6a
......@@ -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)
{
......
......@@ -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;
}
......
......@@ -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']});
}
}
......
......@@ -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
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment