From b1260bf33d153327dcb227bc53becb05eabfee7b Mon Sep 17 00:00:00 2001 From: Tomas Kopecek Date: Nov 07 2019 16:44:45 +0000 Subject: PR#1724: don't expect all buildReferences fields (koji-gc) Merges #1724 https://pagure.io/koji/pull-request/1724 Fixes: #1723 https://pagure.io/koji/issue/1723 koji-gc expect ordered output of buildReferences --- diff --git a/util/koji-gc b/util/koji-gc index 9be6572..171e7bb 100755 --- a/util/koji-gc +++ b/util/koji-gc @@ -446,21 +446,21 @@ def handle_trash(): continue #XXX - this is more data than we need # also, this call takes waaaay longer than it should - if refs['tags']: + if refs.get('tags'): # must have been tagged just now print("[%i/%i] Build is tagged [?]: %s" % (i, N, nvr)) continue - if refs['rpms']: + if refs.get('rpms'): if options.debug: print("[%i/%i] Build has %i rpm references: %s" % (i, N, len(refs['rpms']), nvr)) #pprint.pprint(refs['rpms']) continue - if refs['archives']: + if refs.get('archives'): if options.debug: print("[%i/%i] Build has %i archive references: %s" % (i, N, len(refs['archives']), nvr)) #pprint.pprint(refs['archives']) continue - if refs['component_of']: + if refs.get('component_of'): if options.debug: print("[%i/%i] Build is a component of archives: %s" % (i, N, nvr)) continue