Select the most recent backup previous to the date
When restore data with --restore-from-date option from local storage, The most recent backup subsequent to the specified date will be selected. According to the detailed desciptions from README.rst, the --restore-from-date option will select the most recent backup previous to the specified date. The patch fixed the issue. Change-Id: Iaac936c845ab5ccddd59c751a773e6f190dc064a Closes-Bug: #1644478 Signed-off-by: Shangzhong Zhu <zhu.shangzhong@zte.com.cn>
This commit is contained in:
parent
9efe7e4922
commit
16e68e351a
|
@ -101,7 +101,7 @@ class Storage(object):
|
||||||
increments = backup.get_increments()
|
increments = backup.get_increments()
|
||||||
|
|
||||||
return {level: backup for level, backup in increments.iteritems()
|
return {level: backup for level, backup in increments.iteritems()
|
||||||
if not recent_to_date or backup.timestamp >= recent_to_date}
|
if not recent_to_date or backup.timestamp <= recent_to_date}
|
||||||
|
|
||||||
def remove_older_than(self, engine, remove_older_timestamp,
|
def remove_older_than(self, engine, remove_older_timestamp,
|
||||||
hostname_backup_name):
|
hostname_backup_name):
|
||||||
|
|
|
@ -70,7 +70,7 @@ class PhysicalStorage(base.Storage):
|
||||||
level=0) for t in self.listdir(path)]
|
level=0) for t in self.listdir(path)]
|
||||||
if recent_to_date:
|
if recent_to_date:
|
||||||
zeros = [zero for zero in zeros
|
zeros = [zero for zero in zeros
|
||||||
if zero.timestamp >= recent_to_date]
|
if zero.timestamp <= recent_to_date]
|
||||||
return zeros
|
return zeros
|
||||||
|
|
||||||
@abc.abstractmethod
|
@abc.abstractmethod
|
||||||
|
|
Loading…
Reference in New Issue