summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorTristan Cacqueray <tdecacqu@redhat.com>2019-05-23 23:16:10 +0000
committerTristan Cacqueray <tdecacqu@redhat.com>2019-05-23 23:18:08 +0000
commit0eb80dd3f4db45fd8a45bfa909cab2bb2909ad8d (patch)
tree0b5a55f7e3fa5f4f6bfa2ea6d8fd306af51a73f0 /tools
parentdd954db3cc0b3504d018db7ff396b443deaac477 (diff)
downloadzuul-0eb80dd3f4db45fd8a45bfa909cab2bb2909ad8d.tar.gz
encrypt_secret: display the full_url on error
When the project or tenant is misspelled, an exception is raised with little informations. This change adds an error message to print the used url. Change-Id: Ifba7b02204894b41b6d4573c0ac1d40e17bd09b8
Diffstat (limited to 'tools')
-rwxr-xr-xtools/encrypt_secret.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/tools/encrypt_secret.py b/tools/encrypt_secret.py
index 14e3598f0..e2ae048cd 100755
--- a/tools/encrypt_secret.py
+++ b/tools/encrypt_secret.py
@@ -105,7 +105,12 @@ def main():
else:
req = Request("%s/api/tenant/%s/key/%s.pub" % (
args.url.rstrip('/'), args.tenant, args.project))
- pubkey = urlopen(req, context=ssl_ctx)
+ try:
+ pubkey = urlopen(req, context=ssl_ctx)
+ except Exception:
+ sys.stderr.write(
+ "ERROR: Couldn't retrieve project key via %s\n" % req.full_url)
+ raise
if args.infile:
with open(args.infile) as f: