Restore latest snapshot if no date is provided

This commit is contained in:
Kristóf Tóth 2018-08-06 14:55:58 +02:00
parent cbb807dfb4
commit 59dce4a848
1 changed files with 7 additions and 1 deletions

View File

@ -4,6 +4,7 @@
from os.path import join as joinpath
from os.path import basename
from os import makedirs
from datetime import datetime
from dateutil import parser as dateparser
@ -55,7 +56,12 @@ class DirectorySnapshottingEventHandler(EventHandlerBase):
return data
def handle_restore_snapshot(self, data):
date = dateparser.parse(data['value'])
date = dateparser.parse(
data.get(
'value',
datetime.now().isoformat()
)
)
LOG.debug(
'Restoring snapshots (@ %s) of directories %s',
date,