mirror of
https://github.com/OpenNebula/one.git
synced 2025-03-29 18:50:08 +03:00
* Make VM scheduled backup backward compatible Signed-off-by: Pavel Czerny <pczerny@opennebula.io>
This commit is contained in:
parent
e18d1b6d4f
commit
71bb9e3263
@ -328,7 +328,7 @@ Request::ErrorCode VirtualMachineAllocate::pool_allocate(
|
||||
}
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
/* Create ScheduleAction and associate to the BackupJob */
|
||||
/* Create ScheduleAction and associate to the VM */
|
||||
/* ---------------------------------------------------------------------- */
|
||||
for (const auto& sa : sas)
|
||||
{
|
||||
@ -354,7 +354,7 @@ Request::ErrorCode VirtualMachineAllocate::pool_allocate(
|
||||
}
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
/* Associate SCHED_ACTIONS to the BackupJob */
|
||||
/* Associate SCHED_ACTIONS to the VM */
|
||||
/* ---------------------------------------------------------------------- */
|
||||
if ( auto vm = vmpool->get(id) )
|
||||
{
|
||||
@ -1493,8 +1493,10 @@ Request::ErrorCode BackupJobAllocate::pool_allocate(
|
||||
|
||||
bool sa_error = false;
|
||||
|
||||
for (const auto& sa : sas)
|
||||
for (auto& sa : sas)
|
||||
{
|
||||
sa->remove("ARGS"); // ARGS not used for Backup Job Scheduled Action
|
||||
|
||||
int sa_id = sapool->allocate(PoolObjectSQL::BACKUPJOB, id, 0, sa.get(),
|
||||
att.resp_msg);
|
||||
|
||||
|
@ -226,7 +226,7 @@ void BackupJobSchedAdd::request_execute(xmlrpc_c::paramList const& _paramList,
|
||||
return;
|
||||
}
|
||||
|
||||
const VectorAttribute * va = tmpl->get("SCHED_ACTION");
|
||||
VectorAttribute * va = tmpl->get("SCHED_ACTION");
|
||||
|
||||
if ( va == nullptr )
|
||||
{
|
||||
@ -236,6 +236,8 @@ void BackupJobSchedAdd::request_execute(xmlrpc_c::paramList const& _paramList,
|
||||
return;
|
||||
}
|
||||
|
||||
va->remove("ARGS"); // ARGS not used for Backup Job Scheduled Action
|
||||
|
||||
auto sa_id = sapool->allocate(PoolObjectSQL::BACKUPJOB, bj_id, time(0), va, att.resp_msg);
|
||||
|
||||
if ( sa_id < 0 )
|
||||
|
@ -647,6 +647,11 @@ int ScheduledActionManager::vm_action_call(int vmid, int sa_id, string& error)
|
||||
int dsid = -1;
|
||||
bool reset = false;
|
||||
|
||||
if (args.size() == 1)
|
||||
{
|
||||
args.push("0"); // For backward compatibility set reset = false
|
||||
}
|
||||
|
||||
if (!parse_args(args, dsid, reset))
|
||||
{
|
||||
error = "Missing or malformed ARGS for: backup."
|
||||
|
Loading…
x
Reference in New Issue
Block a user