← Back to team overview

sts-sponsors team mailing list archive

[Merge] ~troyanov/maas:backport-print-sslerror-3.2 into maas:3.2

 

Anton Troyanov has proposed merging ~troyanov/maas:backport-print-sslerror-3.2 into maas:3.2.

Commit message:
chore(cli): print SSLError.reason

(cherry picked from commit 1dc51ed9092eb3fcaa8d5bc9f6ec8ee1f886c80e)


Requested reviews:
  MAAS Maintainers (maas-maintainers)

For more details, see:
https://code.launchpad.net/~troyanov/maas/+git/maas/+merge/439141
-- 
Your team MAAS Committers is subscribed to branch maas:3.2.
diff --git a/src/maascli/api.py b/src/maascli/api.py
index 7196977..1a4c14c 100644
--- a/src/maascli/api.py
+++ b/src/maascli/api.py
@@ -49,10 +49,11 @@ def http_request(
         if isinstance(url, bytes):
             url = url.decode("ascii")
         return http.request(url, method, body=body, headers=headers)
-    except httplib2.ssl.SSLError:
+    except httplib2.ssl.SSLError as error:
         raise CommandError(
             "Certificate verification failed, use --insecure/-k to "
             "disable the certificate check."
+            f"{getattr(error, 'reason', '')}"
         )
 
 

Follow ups