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:
parent
d869a19c9e
commit
4ea5167ef0
@ -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 },
|
||||
};
|
||||
}
|
||||
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user