]> git.proxmox.com Git - pmg-api.git/commitdiff
api: pbs: try to delete schedule on remote deletion
authorThomas Lamprecht <t.lamprecht@proxmox.com>
Wed, 18 Nov 2020 15:48:59 +0000 (16:48 +0100)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Wed, 18 Nov 2020 15:48:59 +0000 (16:48 +0100)
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
src/PMG/API2/PBS/Remote.pm

index 2eba9bb891f9febc921fbb18ae030c46c145b03d..094ba2fa48af79cc8529ecde8cfc5efee4908bfa 100644 (file)
@@ -200,7 +200,6 @@ __PACKAGE__->register_method ({
        my ($param) = @_;
 
        my $code = sub {
-
            my $conf = PMG::PBSConfig->new();
            my $ids = $conf->{ids};
 
@@ -212,6 +211,8 @@ __PACKAGE__->register_method ({
            delete $ids->{$remote};
 
            $conf->write();
+
+           eval { PMG::PBSSchedule::delete_schedule($remote) }; # best effort only
        };
 
        PMG::PBSConfig::lock_config($code, "delete PBS remote failed");