]> xenbits.xensource.com Git - osstest.git/commitdiff
ts-hosts-allocate-Executive: add a label to loop over candidates
authorIan Campbell <ian.campbell@citrix.com>
Wed, 16 Sep 2015 11:47:42 +0000 (12:47 +0100)
committerIan Jackson <Ian.Jackson@eu.citrix.com>
Fri, 18 Sep 2015 15:15:41 +0000 (16:15 +0100)
I'm going to want to "next CANDIDATE" from within a nested loop.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
ts-hosts-allocate-Executive

index c9aae885edd49bd977d1b11314690b69a45df45a..294395d72232bcf018134e5a6ce5e0e11482bc5e 100755 (executable)
@@ -313,6 +313,7 @@ END
     my @candidates;
     my $any=0;
 
+  CANDIDATE:
     while (my $candrow= $findhostsq->fetchrow_hashref()) {
         $candrow->{Warnings}= [ ];
         $candrow->{Reso}= "$candrow->{restype} $candrow->{resname}";
@@ -343,7 +344,7 @@ END
            my $erow= $equivflagscheckq->fetchrow_hashref();
            if (!$erow) {
                print DEBUG "$dbg EQUIV $equiv->{FormalClass} NO-CLASSES\n";
-               next;
+               next CANDIDATE;
            }
            my $eq= $erow->{hostflag};
            print DEBUG "$dbg EQUIV $equiv->{FormalClass} MAYBE $eq\n";
@@ -358,7 +359,7 @@ END
 
         print DEBUG "$dbg FLAGS MISSINGFLAGS: @missingflags.\n";
         if (@missingflags) {
-            next unless defined $use;
+            next CANDIDATE unless defined $use;
             push @{ $candrow->{Warnings} },
                 "specified host lacks flags @missingflags";
         }