From: John Mulligan Date: Wed, 29 Nov 2023 20:44:04 +0000 (-0500) Subject: script/build-integration-branch: add a better error when github api access fails X-Git-Tag: v19.3.0~368^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=269973e919288fe4384f94106c07f9af5b5ff3d4;p=ceph.git script/build-integration-branch: add a better error when github api access fails 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 --- diff --git a/src/script/build-integration-branch b/src/script/build-integration-branch index 5d7c37e56fcc..b5f53aa21017 100755 --- a/src/script/build-integration-branch +++ b/src/script/build-integration-branch @@ -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))