]> xenbits.xensource.com Git - people/iwj/osstest.git/commitdiff
selecthost: Honour IDENT_hostflagadjust runvar
authorIan Jackson <ian.jackson@eu.citrix.com>
Mon, 10 Apr 2017 15:29:52 +0000 (15:29 +0000)
committerIan Jackson <Ian.Jackson@eu.citrix.com>
Wed, 12 Apr 2017 11:13:03 +0000 (12:13 +0100)
This allows runvars to override hostflags from the resource database
or configuration.

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
Osstest/TestSupport.pm

index fb62dfbb44ae0b1c1f7baf9fcb15b0c06b328b53..2b4a1f4d51086116b454db935c3b8dd4bc00a520 100644 (file)
@@ -966,6 +966,14 @@ sub selecthost ($) {
 
     $ho->{Flags} = $mhostdb->get_flags($ho);
 
+    foreach my $adj (split /,/, ($r{"${ident}_hostflagadjust"} // '')) {
+       if ($adj =~ s/^!//) {
+           delete $ho->{Flags}{$adj};
+       } else {
+           $ho->{Flags}{$adj} = 1;
+       }
+    }
+
     #----- fqdn -----
 
     my $defaultfqdn = $name;