This is an automated email from the git hooks/post-receive script.
mreynolds pushed a commit to branch 389-ds-base-1.4.1
in repository 389-ds-base.
The following commit(s) were added to refs/heads/389-ds-base-1.4.1 by this push:
new 3d5bb2c Issue 50850 - Fix dsctl healthcheck for python36
3d5bb2c is described below
commit 3d5bb2c2636e77f8655fd4c599526f0303fc3db1
Author: Mark Reynolds <mreynolds(a)redhat.com>
AuthorDate: Thu Jan 23 12:22:21 2020 -0500
Issue 50850 - Fix dsctl healthcheck for python36
Description: dsctl health check, specifically the certificate expiring
checks, were using python37 specific functions, but these
do not work on python36. Needed to replace fromisoformat()
with something more portable.
relates:
https://pagure.io/389-ds-base/issue/50850
Reviewed by: firstyear(Thanks!)
---
src/lib389/lib389/nss_ssl.py | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/src/lib389/lib389/nss_ssl.py b/src/lib389/lib389/nss_ssl.py
index 587adcd..77ddfe2 100644
--- a/src/lib389/lib389/nss_ssl.py
+++ b/src/lib389/lib389/nss_ssl.py
@@ -79,13 +79,15 @@ class NssSsl(object):
cert_list.append(self.get_cert_details(cert[0]))
for cert in cert_list:
- if date.fromisoformat(cert[3].split()[0]) - date.today() <
timedelta(days=0):
+ cert_date = cert[3].split()[0]
+ diff_date = datetime.strptime(cert_date, '%Y-%m-%d').date() -
datetime.today().date()
+ if diff_date < timedelta(days=0):
# Expired
report = copy.deepcopy(DSCERTLE0002)
report['detail'] =
report['detail'].replace('CERT', cert[0])
yield report
- elif date.fromisoformat(cert[3].split()[0]) - date.today() <
timedelta(days=30):
- # Expiring
+ elif diff_date < timedelta(days=30):
+ # Expiring within 30 days
report = copy.deepcopy(DSCERTLE0001)
report['detail'] =
report['detail'].replace('CERT', cert[0])
yield report
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.