Browse Source

Fixed remove backups older than

Change-Id: Ifcff9567a09b5e04ce95d0fb48ff2016c8a1dc53
Closes-Bug: 1626190
changes/87/374287/1
Saad Zaher 5 years ago
parent
commit
368919a0c6
  1. 2
      freezer/job.py
  2. 4
      freezer/storage/base.py

2
freezer/job.py

@ -219,7 +219,7 @@ class AdminJob(Job):
self.conf.hostname_backup_name)
return {}
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)
return {}

4
freezer/storage/base.py

@ -145,6 +145,10 @@ class Storage(object):
:type remove_older_timestamp: int
: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 = [b for b in backups
if b.latest_update.timestamp <= remove_older_timestamp]

Loading…
Cancel
Save