From 93bc843682d75628f1b8d33eafeaf41b06ebce16 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lubom=C3=ADr=20Sedl=C3=A1=C5=99?= Date: Thu, 13 Sep 2018 12:32:28 +0200 Subject: [PATCH] ostree: Fix handler crash without commit ID MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit If there is no new commit in the repo, we should not wait for a signature, as there is nothing to sign. Fixes: https://pagure.io/pungi/issue/1046 Signed-off-by: Lubomír Sedlář --- bin/pungi-wait-for-signed-ostree-handler | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/bin/pungi-wait-for-signed-ostree-handler b/bin/pungi-wait-for-signed-ostree-handler index fbe29053..eddda647 100755 --- a/bin/pungi-wait-for-signed-ostree-handler +++ b/bin/pungi-wait-for-signed-ostree-handler @@ -55,6 +55,10 @@ if __name__ == '__main__': repo = data['local_repo_path'] commit = data['commitid'] + if not commit: + print("No new commit was created, nothing will get signed.") + sys.exit(0) + path = '%s/objects/%s/%s.commitmeta' % (repo, commit[:2], commit[2:]) config = fedmsg.config.load_config()