5
0
mirror of git://git.proxmox.com/git/pve-guest-common.git synced 2024-12-24 21:34:13 +03:00

Add config parameter 'source'.

This parameter is useful for restoring the replication status.
It is also corrected if it is missing or wrong.
This commit is contained in:
Wolfgang Link 2018-05-09 14:48:22 +02:00 committed by Wolfgang Bumiller
parent d869a19c9e
commit 4ea5167ef0
2 changed files with 11 additions and 0 deletions

View File

@ -79,6 +79,11 @@ my $defaultData = {
default => '*/15',
optional => 1,
},
source => {
description => "Source of the replication.",
type => 'string', format => 'pve-node',
optional => 1,
},
},
};
@ -278,6 +283,7 @@ sub options {
rate => { optional => 1 },
schedule => { optional => 1 },
remove_job => { optional => 1 },
source => { optional => 1 },
};
}

View File

@ -285,6 +285,11 @@ sub job_status {
$jobcfg->{next_sync} = $next_sync;
if (!defined($jobcfg->{source}) || $jobcfg->{source} ne $local_node) {
$jobcfg->{source} = $cfg->{ids}->{$jobid}->{source} = $local_node;
PVE::ReplicationConfig::write($cfg);
}
$jobs->{$jobid} = $jobcfg;
}