api: subscription update: report error if removing ceph-auth file fails

Print a warning if the file could not deleted (if it was actually
existed)

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
This commit is contained in:
Thomas Lamprecht 2024-10-01 15:51:06 +02:00
parent 5f403490f6
commit abbf6dedb9

View File

@ -94,7 +94,7 @@ sub write_etc_subscription {
$filename, "/etc/apt/auth.conf.d/pve.conf", "enterprise.proxmox.com/debian/pve", $info);
if (!(defined($info->{key}) && defined($info->{serverid}))) {
unlink "/etc/apt/auth.conf.d/ceph.conf";
unlink "/etc/apt/auth.conf.d/ceph.conf" or $!{ENOENT} or die "failed to remove apt auth ceph.conf - $!";
} else {
# FIXME: improve this, especially the selection of valid ceph-releases
# NOTE: currently we should add future ceph releases as early as possible, to ensure that