From 559cb97cd44fde405172f5ef228649e98b55dd1d Mon Sep 17 00:00:00 2001 From: Alarig Le Lay Date: Sat, 27 Jul 2024 14:43:42 +0200 Subject: [PATCH] Sanitising a bit the date parsing in case there are spaces Signed-off-by: Alarig Le Lay --- check_domain_expiration_rdap.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/check_domain_expiration_rdap.py b/check_domain_expiration_rdap.py index b89e6f1..898e055 100755 --- a/check_domain_expiration_rdap.py +++ b/check_domain_expiration_rdap.py @@ -97,7 +97,8 @@ def parse_ldap(domain, rdap_server): raw_expiration.append(line[3]) elif len(raw_expiration) == 1: - fecha = raw_expiration[0].split('T')[0] + fecha = raw_expiration[0].split('T')[0].strip().split() + fecha = fecha[0] today = datetime.datetime.now() delta = datetime.datetime.strptime(fecha, '%Y-%m-%d') - today raw_expiration[0] = delta.days