Skip to contentSkip to conversation

ts-hosts-allocate-Executive: Fix an undefined warning

PATCH In review Ian Jackson 2 participants 2 messages Jan 29, 2015

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ts-hosts-allocate-Executive: Fix an undefined warning

$esrow is autovivified as { } by

            $candrow->{EquivMostRecentStatus} = $esrow->{status}

so use %$esrow which in scalar context is true iff the hash is nonempty.

---
 ts-hosts-allocate-Executive |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
ts-hosts-allocate-Executive +1 -1
index 4d5e3bb..7a9411d 100755
@@ -372,7 +372,7 @@ END
 	    $candrow->{EquivMostRecentStatus} = $esrow->{status};
 	    print DEBUG "$dbg EQUIV-MOST-RECENT ";
 	    print DEBUG ("$esrow->{flight}.$esrow->{job}".
-			 " $esrow->{val} $esrow->{status}") if $esrow;
+			 " $esrow->{val} $esrow->{status}") if %$esrow;
 	    print DEBUG ".\n";
 	}
 
Signature · 1 line
1.7.10.4
Acked-by on v1 1/1
#1 lore raw
Quoted 6 lines · Ian Jackson

$esrow is autovivified as { } by

            $candrow->{EquivMostRecentStatus} = $esrow->{status}

so use %$esrow which in scalar context is true iff the hash is nonempty.

I'll either push this ontop of the existing queue if that needs restarting for some reason, or along with the libvirt stuff which we discussed would go in next (along with your ap-push linux cleanups)

Quoted 17 lines
---
 ts-hosts-allocate-Executive |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
ts-hosts-allocate-Executive +1 -1
index 4d5e3bb..7a9411d 100755
@@ -372,7 +372,7 @@ END
 	    $candrow->{EquivMostRecentStatus} = $esrow->{status};
 	    print DEBUG "$dbg EQUIV-MOST-RECENT ";
 	    print DEBUG ("$esrow->{flight}.$esrow->{job}".
-			 " $esrow->{val} $esrow->{status}") if $esrow;
+			 " $esrow->{val} $esrow->{status}") if %$esrow;
 	    print DEBUG ".\n";
 	}