]> git.proxmox.com Git - pve-common.git/commitdiff
pbs client: delete password: return success for non-existent file
authorFabian Ebner <f.ebner@proxmox.com>
Wed, 20 Jul 2022 10:59:41 +0000 (12:59 +0200)
committerWolfgang Bumiller <w.bumiller@proxmox.com>
Fri, 4 Nov 2022 13:01:22 +0000 (14:01 +0100)
It's currently possible to add a remote in PMG without password (via
API), but deletion of such a remote would fail here.

Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
src/PVE/PBSClient.pm

index 37385d7cbbe06e9e8b9c932d40873847aafcb5b1..f19199ca6673799540e172e950f4cf89094880d8 100644 (file)
@@ -77,7 +77,7 @@ sub delete_password {
 
     my $pwfile = password_file_name($self);
 
-    unlink $pwfile or die "deleting password file failed - $!\n";
+    unlink $pwfile or $! == ENOENT or die "deleting password file failed - $!\n";
 };
 
 sub get_password {