Skip to content
Snippets Groups Projects
Commit 13bf0fa1 authored by Florent Thiery's avatar Florent Thiery
Browse files

fix date parserrefs #21504

parent b22266b6
No related branches found
No related tags found
No related merge requests found
...@@ -36,8 +36,8 @@ def test_last_backup_is_recent(server): ...@@ -36,8 +36,8 @@ def test_last_backup_is_recent(server):
cmd = 'ssh -o StrictHostKeyChecking=no %s ls -l %s | grep latest' % (server, path) cmd = 'ssh -o StrictHostKeyChecking=no %s ls -l %s | grep latest' % (server, path)
status, out = subprocess.getstatusoutput(cmd) status, out = subprocess.getstatusoutput(cmd)
if status == 0: if status == 0:
date = out.strip().split(' ')[-2] date = out.strip().split(' ')[-1]
pdate = datetime.strptime(date, '%Y-%m-%d-%HMS') pdate = datetime.strptime(date, '%Y-%m-%d-%H%M%S')
if (datetime.now() - pdate).days > 2: if (datetime.now() - pdate).days > 2:
print('Backup is older than 2 days') print('Backup is older than 2 days')
return False return False
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment