Instead of copying all of %r into %v, have the template substitutor
fall back to %r from %v.
This is going to be important when we have host-reuse-related access
control to %r.
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
$pat =~ s{\%(\w*)\%}{
$1 eq '' ? '%' :
defined($v->{$1}) ? $v->{$1} :
+ defined($r{$1}) ? $r{$1} :
next;
}ge;
# and return the first pattern we managed to completely substitute
# returns the full netboot filename path
# in array context, returns (dir, pathtail)
# where dir does not depend on $templatekeytail
- my %v = %r;
+ my %v;
my $firmware = get_host_property($ho, "firmware");
my $templatekeybase = $firmware eq 'uefi' ? 'NetGrub' : 'Pxe';
$templatekeytail //= 'Templates';