Fixed remove backups older than
Change-Id: Ifcff9567a09b5e04ce95d0fb48ff2016c8a1dc53 Closes-Bug: 1626190
This commit is contained in:
parent
7082f39b6c
commit
368919a0c6
|
@ -219,7 +219,7 @@ class AdminJob(Job):
|
||||||
self.conf.hostname_backup_name)
|
self.conf.hostname_backup_name)
|
||||||
return {}
|
return {}
|
||||||
elif self.conf.remove_older_than:
|
elif self.conf.remove_older_than:
|
||||||
self.storage.remove_older_than(self.conf.remove_before_date,
|
self.storage.remove_older_than(self.conf.remove_older_than,
|
||||||
self.conf.hostname_backup_name)
|
self.conf.hostname_backup_name)
|
||||||
return {}
|
return {}
|
||||||
|
|
||||||
|
|
|
@ -145,6 +145,10 @@ class Storage(object):
|
||||||
:type remove_older_timestamp: int
|
:type remove_older_timestamp: int
|
||||||
:type hostname_backup_name: str
|
:type hostname_backup_name: str
|
||||||
"""
|
"""
|
||||||
|
LOG.info('Removing backups older than {0} for {1}'.format(
|
||||||
|
remove_older_timestamp,
|
||||||
|
hostname_backup_name
|
||||||
|
))
|
||||||
backups = self.find_all(hostname_backup_name)
|
backups = self.find_all(hostname_backup_name)
|
||||||
backups = [b for b in backups
|
backups = [b for b in backups
|
||||||
if b.latest_update.timestamp <= remove_older_timestamp]
|
if b.latest_update.timestamp <= remove_older_timestamp]
|
||||||
|
|
Loading…
Reference in New Issue