[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[OSSTEST PATCH 22/60] history reporting: Skip undefined keys


  • To: <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Ian Jackson <ian.jackson@xxxxxxxxxxxxx>
  • Date: Fri, 14 Aug 2020 18:21:27 +0100
  • Authentication-results: esa3.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none
  • Cc: Ian Jackson <ian.jackson@xxxxxxxxxxxxx>
  • Delivery-date: Fri, 14 Aug 2020 17:27:21 +0000
  • Ironport-sdr: amjdhmGLgIRYhmIw7aMb9wUVgR5z/Odj1giNmh92Gvjm5PQ0Bs6KOG7PZNRhAW8wzu4Fvkk5zX p3/sVR9idCQf7MP24+zUen7ll+H0BHpMw+qwwK95luKBNOoxBbICXT+CCI0dST3u1C1D3ocfMy 31wMM7Vkuhy2IaY+I7UEEG08J8gEj+Ps4Xh2Z54fdJ8jia30ofjOGL1lKtISBMBDUnAYvermSg SuRAU6OPYrWZ9vz2FMRi8fDs6xyKUaFz/TtZmE/9ITaUEdeJu8NwSH2+bUMqGwUmlh095frNbV LiQ=
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

This makes it work if the caller's cached hash contains an key which
is bound to undef.

sg-report-host-history already does this, which currently causes:

 Use of uninitialized value $_ in substitution (s///) at 
Osstest/HistoryReport.pm line 134.
 Use of uninitialized value $_ in printf at Osstest/HistoryReport.pm line 135.

Signed-off-by: Ian Jackson <ian.jackson@xxxxxxxxxxxxx>
---
 Osstest/HistoryReport.pm | 1 +
 1 file changed, 1 insertion(+)

diff --git a/Osstest/HistoryReport.pm b/Osstest/HistoryReport.pm
index 61b1ee8f..cb8c6ca1 100644
--- a/Osstest/HistoryReport.pm
+++ b/Osstest/HistoryReport.pm
@@ -131,6 +131,7 @@ sub cache_write_entry ($$) {
        foreach my $k (sort keys %$h) {
            next if $k =~ m/^\%/;
            $_ = $h->{$k};
+           next unless defined;
            s{[^-+=/~:;_.,\w]}{ sprintf "%%%02x", ord $& }ge;
            printf $fh " %s=%s", $k, $_;
        }
-- 
2.11.0




 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.