From 8b680bb3b6fc52f9a8d83d25070a98f68dafe260 Mon Sep 17 00:00:00 2001 From: lissav Date: Mon, 1 Apr 2013 16:50:16 +0000 Subject: [PATCH] fix defect 3412 git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/branches/2.8@15767 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- xCAT-server/lib/perl/xCAT/Postage.pm | 25 ++++++++++++++----------- xCAT-server/lib/perl/xCAT/Template.pm | 9 ++++----- 2 files changed, 18 insertions(+), 16 deletions(-) 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);