]> git.proxmox.com Git - pve-manager.git/commitdiff
replication: check for source == target on job creation
authorFabian Grünbichler <f.gruenbichler@proxmox.com>
Tue, 11 Aug 2020 12:31:11 +0000 (14:31 +0200)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Thu, 20 Aug 2020 11:47:21 +0000 (13:47 +0200)
and die.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
PVE/API2/ReplicationConfig.pm

index 4a25a92b520d3c390405c84e127d03887759c031..aea3bff3ffc31a53d297e9dc1d93a31d5b68493b 100644 (file)
@@ -131,6 +131,9 @@ __PACKAGE__->register_method ({
 
        $param->{source} //= $source;
 
+       die "Source and target must not be identical\n"
+           if $param->{target} eq $source;
+
        my $guest_class = $PVE::API2::Replication::lookup_guest_class->($guest_info->{type});
        my $guest_conf = $guest_class->load_config($guest, $source);
        my $rep_volumes = $guest_class->get_replicatable_volumes(PVE::Storage::config(), $guest, $guest_conf, 0, 0);