From 93bc843682d75628f1b8d33eafeaf41b06ebce16 Mon Sep 17 00:00:00 2001 From: Lubomír Sedlář Date: Sep 19 2018 11:07:03 +0000 Subject: ostree: Fix handler crash without commit ID 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ář --- diff --git a/bin/pungi-wait-for-signed-ostree-handler b/bin/pungi-wait-for-signed-ostree-handler index fbe2905..eddda64 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()