From a197c8caf8e3a15e0adda9247ab3ed55a78af7cc Mon Sep 17 00:00:00 2001 From: Michal Arbet Date: Sun, 2 Feb 2020 18:49:17 +0100 Subject: [PATCH] Fix creation of full backup when using cindernative incremental Per configuration freezer should firstly create full backup automatically if there are no backups for job and config options incremental=True, mode=cindernative are set. This patch is fixing this. From config: >> # When the option is set, freezer will perform a cindernative incremental backup instead of the default full backup. And if True, but volume do not have a base full backup, freezer will do a full backup first. >> #incremental = Change-Id: Ib56c5528bcdedc34c16c209488c7439250dd85e1 --- freezer/openstack/backup.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/freezer/openstack/backup.py b/freezer/openstack/backup.py index aa04106b..7fdd2209 100644 --- a/freezer/openstack/backup.py +++ b/freezer/openstack/backup.py @@ -97,10 +97,8 @@ class BackupOs(object): } backups = cinder.backups.list(search_opts=search_opts) if len(backups) <= 0: - msg = ("Backup volume %s is failed." - "Do a full backup before incremental backup" - % volume_id) - raise Exception(msg) + cinder.backups.create(volume_id, container, name, description, + incremental=False, force=True) else: cinder.backups.create(volume_id, container, name, description, incremental=incremental, force=True)