update-schutzfile-images: don't catch HTTPError
Catching the exception just to print it and exit with non-zero exit return code. Let's not catch it at all. Signed-off-by: Tomáš Hozza <thozza@redhat.com>
This commit is contained in:
parent
d8f353b3b7
commit
c9c94380dc
1 changed files with 3 additions and 6 deletions
|
|
@ -14,12 +14,9 @@ def images_main_commit_id():
|
|||
if token:
|
||||
# this API request doesn't necessarily require a token, but let's use it if we have one
|
||||
req.add_header("Authorization", f"Bearer {token}")
|
||||
try:
|
||||
with urllib.request.urlopen(req, timeout=30) as resp:
|
||||
body = resp.read()
|
||||
except urllib.error.HTTPError as http_error:
|
||||
print(http_error)
|
||||
sys.exit(1)
|
||||
|
||||
with urllib.request.urlopen(req, timeout=30) as resp:
|
||||
body = resp.read()
|
||||
|
||||
data = json.loads(body)
|
||||
return data["sha"]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue