From d77754bdc812b177f03a0f84a83136ccd5b4bae0 Mon Sep 17 00:00:00 2001 From: jbjohnso Date: Mon, 14 Sep 2009 20:28:45 +0000 Subject: [PATCH] -Check in support for #TABLE# template syntax in boottarget kcmdline to be consistent with Template.pm git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@4132 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- xCAT-server/lib/xcat/plugins/boottarget.pm | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/xCAT-server/lib/xcat/plugins/boottarget.pm b/xCAT-server/lib/xcat/plugins/boottarget.pm index 634ec089b..779d18ec5 100644 --- a/xCAT-server/lib/xcat/plugins/boottarget.pm +++ b/xCAT-server/lib/xcat/plugins/boottarget.pm @@ -167,6 +167,21 @@ sub mknetboot my $naval = $naent->{$2}; $kcmdline =~ s/#NODEATTRIB:([^:#]+):([^:#]+)#/$naval/; } + while ($kcmdline =~ /#TABLE:([^:#]+):([^:#]+):([^:#]+)#/) { + if ($2 =~ /THISNODE/ or $2 =~ /\$NODE/) { + my $natab = xCAT::Table->new($1); + my $naent = $natab->getNodeAttribs($node,[$3]); + my $naval = $naent->{$3}; + $kcmdline =~ s/#NODEATTRIB:([^:#]+):([^:#]+):([^:#]+)#/$naval/; + } else { + my $msg = "Table key of $2 not yet supported by boottarget mini-template"; + $callback->({ + error => ["$msg"], + errorcode => [1] + }); + + } + } if($initrd eq ''){ $bptab->setNodeAttribs(