diff --git a/lib/tfw/components/directory_snapshotting_event_handler.py b/lib/tfw/components/directory_snapshotting_event_handler.py index 246bb60..55fcde8 100644 --- a/lib/tfw/components/directory_snapshotting_event_handler.py +++ b/lib/tfw/components/directory_snapshotting_event_handler.py @@ -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,