]> xenbits.xensource.com Git - people/iwj/osstest.git/commitdiff
selecthost: move up the querying of host flags, so they can influence the Ether etc.
authorIan Jackson <iwj@woking.cam.xci-test.com>
Mon, 28 Jan 2013 18:02:52 +0000 (18:02 +0000)
committerIan Jackson <iwj@woking.cam.xci-test.com>
Tue, 29 Jan 2013 11:20:35 +0000 (11:20 +0000)
Osstest.pm

index c954ed3e3de56a38db1fb7a6dba0c8155aa19f19..71b4bba1b981391ea7d701e6ac0bb8c77402b83a 100644 (file)
@@ -1714,6 +1714,16 @@ END
     $ho->{DhcpLeases}= get_host_property($ho,'dhcp-leases',$c{Dhcp3Leases});
     $ho->{Fqdn}= get_host_property($ho,'fqdn',"$name.$c{TestHostDomain}");
 
+    $ho->{Flags}= { };
+    my $flagsq= $dbh_tests->prepare(<<END);
+        SELECT hostflag FROM hostflags WHERE hostname=?
+END
+    $flagsq->execute($name);
+    while (my ($flag) = $flagsq->fetchrow_array()) {
+        $ho->{Flags}{$flag}= 1;
+    }
+    $flagsq->finish();
+
     if (!$ho->{Ether} || !$ho->{Power}) {
         my $dbh_config= opendb('configdb');
         my $selname= $ho->{Fqdn};
@@ -1744,16 +1754,6 @@ END
     $ho->{Ip}= inet_ntoa($ip_packed);
     die "$ho->{Fqdn} ?" unless defined $ho->{Ip};
 
-    $ho->{Flags}= { };
-    my $flagsq= $dbh_tests->prepare(<<END);
-        SELECT hostflag FROM hostflags WHERE hostname=?
-END
-    $flagsq->execute($name);
-    while (my ($flag) = $flagsq->fetchrow_array()) {
-        $ho->{Flags}{$flag}= 1;
-    }
-    $flagsq->finish();
-
     $ho->{Shared}= resource_check_allocated('host', $name);
     $ho->{SharedReady}=
         $ho->{Shared} &&