diff --git a/xCAT-server/lib/perl/xCAT/Postage.pm b/xCAT-server/lib/perl/xCAT/Postage.pm index 34b916a3d..14870dc6a 100644 --- a/xCAT-server/lib/perl/xCAT/Postage.pm +++ b/xCAT-server/lib/perl/xCAT/Postage.pm @@ -701,16 +701,16 @@ sub makescript } # get postscripts for images - my $osimgname = $provmethod; + my $et2; + if($provmethod !~ /^install$|^netboot$|^statelite$/){ # using imagename + + my $osimgname = $provmethod; - if($osimgname =~ /^install$|^netboot$|^statelite$/){ - $osimgname = "$os-$arch-$provmethod-$profile"; - } - my $et2 = + $et2 = $ostab->getAttribs({'imagename' => "$osimgname"}, ['postscripts', 'postbootscripts']); - $ps = $et2->{'postscripts'}; - if ($ps) - { + $ps = $et2->{'postscripts'}; + if ($ps) + { push @scriptd, "# osimage-postscripts-start-here\n"; foreach my $n (split(/,/, $ps)) @@ -722,6 +722,7 @@ sub makescript } } push @scriptd, "# osimage-postscripts-end-here\n"; + } } # get postscripts for node specific @@ -784,9 +785,10 @@ sub makescript } # get postbootscripts for image - my $ips = $et2->{'postbootscripts'}; - if ($ips) - { + if($provmethod !~ /^install$|^netboot$|^statelite$/){ # using imagename + my $ips = $et2->{'postbootscripts'}; + if ($ips) + { my @xcatscripts; my @kitscripts; my @userscripts; @@ -832,6 +834,7 @@ sub makescript } } push @scriptd, "# osimage-postbootscripts-end-here\n"; + } } diff --git a/xCAT-server/lib/perl/xCAT/Template.pm b/xCAT-server/lib/perl/xCAT/Template.pm index a0cb242ac..4a0343657 100644 --- a/xCAT-server/lib/perl/xCAT/Template.pm +++ b/xCAT-server/lib/perl/xCAT/Template.pm @@ -1188,12 +1188,11 @@ sub subvars_for_mypostscript { $os = $et->{'os'}; $arch = $et->{'arch'}; $profile = $et->{'profile'}; + my $osimgname; - - my $osimgname = $provmethod; - if($osimgname =~ /^(install|netboot|statelite)$/){ - $osimgname = "$os-$arch-$provmethod-$profile"; - } + if($provmethod !~ /^install$|^netboot$|^statelite$/){ # using imagename + $osimgname = $provmethod; + } my $osimage_vars; $osimage_vars = getImageitems_for_node($node, \%image_hash, $nodesetstate);