From 4bee8ba35828896165456c51fc68478584fb281b Mon Sep 17 00:00:00 2001 From: vallard Date: Tue, 27 Apr 2010 15:54:13 +0000 Subject: [PATCH] fixed bug where nodeset osimage=foo wouldn't look for default template file if it wasn't found in linuximage table git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@5901 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- xCAT-server/lib/xcat/plugins/anaconda.pm | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/xCAT-server/lib/xcat/plugins/anaconda.pm b/xCAT-server/lib/xcat/plugins/anaconda.pm index 937d730bb..4a0ca4720 100644 --- a/xCAT-server/lib/xcat/plugins/anaconda.pm +++ b/xCAT-server/lib/xcat/plugins/anaconda.pm @@ -612,6 +612,19 @@ sub mkinstall $img_hash{$imagename}->{pkgdir}=$ref1->{'pkgdir'}; } } + # if the install template wasn't found, then lets look for it in the default locations. + unless($img_hash{$imagename}->{template}){ + my $pltfrm=xCAT_plugin::anaconda::getplatform($ref->{'osvers'}); + my $tmplfile=xCAT::SvrUtils::get_tmpl_file_name("$installroot/custom/install/$pltfrm", + $ref->{'profile'}, $ref->{'osvers'}, $ref->{'osarch'}, $ref->{'osvers'}); + if (! $tmplfile) { $tmplfile=xCAT::SvrUtils::get_tmpl_file_name("$::XCATROOT/share/xcat/install/$pltfrm", + $ref->{'profile'}, $ref->{'osvers'}, $ref->{'osarch'}, $ref->{'osvers'}); + } + # if we managed to find it, put it in the hash: + if($tmplfile){ + $img_hash{$imagename}->{template}=$tmplfile; + } + } } else { $callback->( {error => ["The os image $imagename does not exists on the osimage table for $node"],