diff --git a/perl-xCAT/xCAT/ProfiledNodeUtils.pm b/perl-xCAT/xCAT/ProfiledNodeUtils.pm index 3ce61b9d1..7225898b6 100644 --- a/perl-xCAT/xCAT/ProfiledNodeUtils.pm +++ b/perl-xCAT/xCAT/ProfiledNodeUtils.pm @@ -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) { diff --git a/xCAT-buildkit/share/xcat/kits/kit_template/plugins/sample/imageprofile.pm b/xCAT-buildkit/share/xcat/kits/kit_template/plugins/sample/imageprofile.pm index cb9324870..761ac4255 100644 --- a/xCAT-buildkit/share/xcat/kits/kit_template/plugins/sample/imageprofile.pm +++ b/xCAT-buildkit/share/xcat/kits/kit_template/plugins/sample/imageprofile.pm @@ -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; } diff --git a/xCAT-server/lib/xcat/plugins/destiny.pm b/xCAT-server/lib/xcat/plugins/destiny.pm index d1a66c5d6..8af73011e 100644 --- a/xCAT-server/lib/xcat/plugins/destiny.pm +++ b/xCAT-server/lib/xcat/plugins/destiny.pm @@ -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']}); } } diff --git a/xCAT-server/lib/xcat/plugins/profilednodes.pm b/xCAT-server/lib/xcat/plugins/profilednodes.pm index bc22d2858..4cbafc063 100644 --- a/xCAT-server/lib/xcat/plugins/profilednodes.pm +++ b/xCAT-server/lib/xcat/plugins/profilednodes.pm @@ -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