From 13bf0fa173afa90c3c0329b47f6ec5765a5c2663 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florent=20Thi=C3=A9ry?= <florent.thiery@ubicast.eu> Date: Tue, 16 May 2017 19:00:40 +0200 Subject: [PATCH] fix date parserrefs #21504 --- tests/test_backup.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/test_backup.py b/tests/test_backup.py index 264a7049..aea304cd 100755 --- a/tests/test_backup.py +++ b/tests/test_backup.py @@ -36,8 +36,8 @@ def test_last_backup_is_recent(server): cmd = 'ssh -o StrictHostKeyChecking=no %s ls -l %s | grep latest' % (server, path) status, out = subprocess.getstatusoutput(cmd) if status == 0: - date = out.strip().split(' ')[-2] - pdate = datetime.strptime(date, '%Y-%m-%d-%HMS') + date = out.strip().split(' ')[-1] + pdate = datetime.strptime(date, '%Y-%m-%d-%H%M%S') if (datetime.now() - pdate).days > 2: print('Backup is older than 2 days') return False -- GitLab