python:gp: Improve working of log messages to avoid confusion
authorAndreas Schneider <asn@samba.org>
Mon, 22 Jan 2024 14:46:24 +0000 (15:46 +0100)
committerAndreas Schneider <asn@cryptomilk.org>
Mon, 29 Jan 2024 10:37:29 +0000 (10:37 +0000)
We should not use the word "Failed". We are totally fine if we can't
connect to NDES in the meantime. This logs:

Try to get root or server certificates.
Unable to install root certificates (requires NDES).
Installing the server certificate only.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=15559

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: David Mulder <dmulder@samba.org>
Reviewed-by: Pavel Filipenský <pfilipensky@samba.org>
Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Mon Jan 29 10:37:29 UTC 2024 on atb-devel-224

python/samba/gp/gp_cert_auto_enroll_ext.py

index 51b2874b371cc04cdee6106505866c0e1a13c9af..9b743cb7f9baa946cff24efd4966d58d3f2f91c5 100644 (file)
@@ -209,12 +209,10 @@ def getca(ca, url, trust_dir):
         r = requests.get(url=url, params={'operation': 'GetCACert',
                                           'message': 'CAIdentifier'})
     except requests.exceptions.ConnectionError:
-        log.warn('Failed to establish a new connection')
+        log.warn('Could not connect to Network Device Enrollment Service.')
         r = None
     if r is None or r.content == b'' or r.headers['Content-Type'] == 'text/html':
-        log.warn('Failed to fetch the root certificate chain.')
-        log.warn('The Network Device Enrollment Service is either not' +
-                 ' installed or not configured.')
+        log.warn('Unable to fetch root certificates (requires NDES).')
         if 'cACertificate' in ca:
             log.warn('Installing the server certificate only.')
             der_certificate = base64.b64decode(ca['cACertificate'])