]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
script/build-integration-branch: add a better error when github api access fails
authorJohn Mulligan <jmulligan@redhat.com>
Wed, 29 Nov 2023 20:44:04 +0000 (15:44 -0500)
committerJohn Mulligan <jmulligan@redhat.com>
Mon, 4 Dec 2023 19:00:58 +0000 (14:00 -0500)
A mysterious `assert(r.ok)` appears after running the script causing me
to read source code. I don't want to read source code every time the
script fails. ;-)

Signed-off-by: John Mulligan <jmulligan@redhat.com>
src/script/build-integration-branch

index 5d7c37e56fcc61a3ddc2eaad354b4fea30d4417c..b5f53aa210177b5cb3eb7818d844e4b35c80bbab 100755 (executable)
@@ -65,7 +65,11 @@ url = baseurl.format(label=label,
                      repo=repo)
 r = requests.get(url,
                  headers={'Authorization': 'token %s' % token})
-assert(r.ok)
+if not r.ok:
+    print("Failed to access github api")
+    print("(Do you have a valid, unexpired github api token?)")
+    sys.exit(1)
+
 j = json.loads(r.text or r.content)
 print("--- found %d issues tagged with %s" % (len(j), label))