Generate a full backup first time

If there isn't any backup of the specified volume, generate a full
backup, but not an incremental one.

Closes-Bug: #1563245
Change-Id: If30e0292671e2be8d026006986b942206cfd2435
This commit is contained in:
Einst Crazy 2016-03-29 09:06:27 +00:00 committed by Pierre-Arthur MATHIEU
parent 08f3da31e9
commit c62a9da7ef
2 changed files with 11 additions and 2 deletions

View File

@ -114,5 +114,14 @@ class BackupOs:
def backup_cinder(self, volume_id, name=None, description=None):
client_manager = self.client_manager
cinder = client_manager.get_cinder()
search_opts = {
'volume_id': volume_id,
'status': 'available',
}
backups = cinder.backups.list(search_opts=search_opts)
if len(backups) > 0 :
incremental = True
else:
incremental = False
cinder.backups.create(volume_id, self.container, name, description,
incremental=True, force=True)
incremental=incremental, force=True)

View File

@ -1,6 +1,6 @@
[metadata]
name = freezer
version = 2.0.0
version = 2.1.0
author = Freezer Team
author-email = openstack-dev@lists.openstack.org
summary = The OpenStack Backup Restore and Disaster Recovery as a Service Platform