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:
parent
af6591e814
commit
20fcf95ceb
@ -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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user