--- PVE/ReplicationConfig.pm | 17 +++++++++++++++++ 1 file changed, 17 insertions(+)
diff --git a/PVE/ReplicationConfig.pm b/PVE/ReplicationConfig.pm index b6cd514..a696a81 100644 --- a/PVE/ReplicationConfig.pm +++ b/PVE/ReplicationConfig.pm @@ -258,6 +258,23 @@ sub delete_job { lock($code); } +sub swap_source_target { + my ($jobid) = @_; + + my $cfg; + + my $code = sub { + $cfg = __PACKAGE__->new(); + my $tmp = $cfg->{ids}->{$jobid}->{source}; + $cfg->{ids}->{$jobid}->{source} = $cfg->{ids}->{$jobid}->{target}; + $cfg->{ids}->{$jobid}->{target} = $tmp; + $cfg->write(); + }; + + lock($code); + return $cfg->{ids}->{$jobid}; +} + package PVE::ReplicationConfig::Cluster; use base qw(PVE::ReplicationConfig); -- 2.11.0 _______________________________________________ pve-devel mailing list pve-devel@pve.proxmox.com https://pve.proxmox.com/cgi-bin/mailman/listinfo/pve-devel