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
>> #incremental = <None>

Change-Id: Ib56c5528bcdedc34c16c209488c7439250dd85e1
Michal Arbet 3 years ago
parent a440501ab6
commit a197c8caf8

@ -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)
cinder.backups.create(volume_id, container, name, description,
incremental=incremental, force=True)