mirror of
https://git.proxmox.com/git/pve-manager
synced 2025-04-28 22:45:23 +00:00
fix #1295: pve daily update: honor new package-notification config
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
This commit is contained in:
parent
b9e706fb85
commit
8432c6d351
@ -51,8 +51,19 @@ if (my $err = $@) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
my $info = eval { PVE::API2::Subscription::read_etc_subscription() };
|
my $info = eval { PVE::API2::Subscription::read_etc_subscription() };
|
||||||
# Assume that users with subscriptions want informations about new packages.
|
|
||||||
my $notify = ($info && $info->{status} eq 'active') ? 1 : 0;
|
my $notify_on = $dccfg->{notify}->{'package-updates'} // 'auto';
|
||||||
|
my $notify = 0;
|
||||||
|
if ($notify_on eq 'auto') {
|
||||||
|
# hosts with subscriptions are likely production system and thus want infos about new packages
|
||||||
|
$notify = ($info && $info->{status} eq 'active') ? 1 : 0;
|
||||||
|
} elsif ($notify_on eq 'always') {
|
||||||
|
$notify = 1;
|
||||||
|
} elsif ($notify_on eq 'never') {
|
||||||
|
$notify = 0;
|
||||||
|
} else {
|
||||||
|
warn "unexpected package-updates notify configuration value '$notify_on'\n";
|
||||||
|
}
|
||||||
eval { PVE::API2::APT->update_database({ node => $nodename, notify => $notify, quiet => 1 }); };
|
eval { PVE::API2::APT->update_database({ node => $nodename, notify => $notify, quiet => 1 }); };
|
||||||
if (my $err = $@) {
|
if (my $err = $@) {
|
||||||
syslog ('err', "update apt database failed: $err");
|
syslog ('err', "update apt database failed: $err");
|
||||||
|
Loading…
Reference in New Issue
Block a user