From 9f39989eb4ec76e77fe93447cd8e1a1d296d96b1 Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Mon, 2 Jun 2014 16:27:20 -0400 Subject: [PATCH] Support shortname directive for templates that may require it --- xCAT-server/lib/perl/xCAT/Template.pm | 3 +++ 1 file changed, 3 insertions(+) diff --git a/xCAT-server/lib/perl/xCAT/Template.pm b/xCAT-server/lib/perl/xCAT/Template.pm index 3ba3117c4..a99a2e9f8 100644 --- a/xCAT-server/lib/perl/xCAT/Template.pm +++ b/xCAT-server/lib/perl/xCAT/Template.pm @@ -219,6 +219,8 @@ sub subvars { } #ok, now do everything else.. + my $shortname = $node; + $shortname =~ s/\..*//; $inc =~ s/#TABLE:([^:]+):([^:]+):([^#]+)#/tabdb($1,$2,$3)/eg; $inc =~ s/#TABLEBLANKOKAY:([^:]+):([^:]+):([^#]+)#/tabdb($1,$2,$3,'1')/eg; $inc =~ s/#INCLUDE_NOP:([^#^\n]+)#/includefile($1,1,0)/eg; @@ -243,6 +245,7 @@ sub subvars { $inc =~ s/#WINDISABLENULLADMIN#/windows_disable_null_admin()/eg; $inc =~ s/#MANAGEDADDRESSMODE#/managed_address_mode()/eg; $inc =~ s/#HOSTNAME#/$node/g; + $inc =~ s/#SHORTNAME#/$shortname/g; $inc =~ s/#GETNODEDOMAIN:([^#]+)#/get_node_domain($1)/eg; my $nrtab = xCAT::Table->new("noderes");