From: Ian Jackson Date: Thu, 20 Aug 2020 16:49:31 +0000 (+0100) Subject: subst_netboot_template: Do not use all of %r X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=a80f6bda34c47ebc61704d48d7e79ebf06a3413a;p=osstest.git subst_netboot_template: Do not use all of %r 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 --- diff --git a/Osstest/TestSupport.pm b/Osstest/TestSupport.pm index be6b711..634d6d2 100644 --- a/Osstest/TestSupport.pm +++ b/Osstest/TestSupport.pm @@ -2876,6 +2876,7 @@ sub subst_netboot_template ($$$) { $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 @@ -2890,7 +2891,7 @@ sub host_netboot_file ($;$) { # 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';