mirror of
https://github.com/avatao-content/baseimage-tutorial-framework
synced 2024-12-22 23:01:55 +00:00
Restore latest snapshot if no date is provided
This commit is contained in:
parent
cbb807dfb4
commit
59dce4a848
@ -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,
|
||||
|
Loading…
Reference in New Issue
Block a user