Merge ~troyanov/maas:backport-print-sslerror-3.3 into maas:3.3

Proposed by Anton Troyanov
Status: Merged
Approved by: Anton Troyanov
Approved revision: a01c7428dbfcb61fbadd21badda5a31cdd89030b
Merge reported by: MAAS Lander
Merged at revision: not available
Proposed branch: ~troyanov/maas:backport-print-sslerror-3.3
Merge into: maas:3.3
Diff against target: 15 lines (+2/-1)
1 file modified
src/maascli/api.py (+2/-1)
Reviewer Review Type Date Requested Status
MAAS Lander Approve
Anton Troyanov Approve
Review via email: mp+439142@code.launchpad.net

Commit message

chore(cli): print SSLError.reason

(cherry picked from commit 1dc51ed9092eb3fcaa8d5bc9f6ec8ee1f886c80e)

To post a comment you must log in.
Revision history for this message
Anton Troyanov (troyanov) :
Revision history for this message
Anton Troyanov (troyanov) wrote (last edit ):

Self approve backport to 3.3

review: Approve
Revision history for this message
MAAS Lander (maas-lander) wrote :

UNIT TESTS
-b backport-print-sslerror-3.3 lp:~troyanov/maas/+git/maas into -b 3.3 lp:~maas-committers/maas

STATUS: SUCCESS
COMMIT: a01c7428dbfcb61fbadd21badda5a31cdd89030b

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/src/maascli/api.py b/src/maascli/api.py
2index 7196977..1a4c14c 100644
3--- a/src/maascli/api.py
4+++ b/src/maascli/api.py
5@@ -49,10 +49,11 @@ def http_request(
6 if isinstance(url, bytes):
7 url = url.decode("ascii")
8 return http.request(url, method, body=body, headers=headers)
9- except httplib2.ssl.SSLError:
10+ except httplib2.ssl.SSLError as error:
11 raise CommandError(
12 "Certificate verification failed, use --insecure/-k to "
13 "disable the certificate check."
14+ f"{getattr(error, 'reason', '')}"
15 )
16
17

Subscribers

People subscribed via source and target branches