1
0
mirror of https://github.com/OpenNebula/one.git synced 2025-03-21 14:50:08 +03:00

F #6333: Parse INCREMENT_MODE in backup jobs

Attribute was not copied to backup config nor parsed
This commit is contained in:
Ruben S. Montero 2023-11-22 13:53:15 +01:00
parent af6591e814
commit 20fcf95ceb
No known key found for this signature in database
GPG Key ID: A0CEA6FA880A1D87

View File

@ -445,9 +445,10 @@ void BackupJob::get_backup_config(Template &tmpl)
/* - BACKUP_VOLATILE */
/* - FS_FREEZE */
/* - MODE */
/* - INCREMENT_MODE */
/* ---------------------------------------------------------------------- */
static vector<string> CONFIG_ATTRIBUTES = { "KEEP_LAST", "BACKUP_VOLATILE",
"FS_FREEZE", "MODE"};
"FS_FREEZE", "MODE", "INCREMENT_MODE"};
string tmp_str;
VectorAttribute* va = new VectorAttribute("BACKUP_CONFIG");
@ -579,6 +580,25 @@ int BackupJob::parse(string& error)
add_template_attribute("MODE", sattr);
if ( sattr == "INCREMENT" )
{
if ( erase_template_attribute("INCREMENT_MODE", sattr) == 0 || sattr.empty() )
{
sattr = "CBT";
}
else
{
one_util::toupper(sattr);
if ((sattr != "CBT") && (sattr != "SNAPSHOT"))
{
sattr = "CBT";
}
}
add_template_attribute("INCREMENT_MODE", sattr);
}
erase_template_attribute("EXECUTION", sattr);
Execution exec = str_to_execution(sattr);