mirror of
https://git.proxmox.com/git/pve-common
synced 2025-08-02 13:27:07 +00:00
PVE/Subscription.pm - avoid warn, and return error message instead
This commit is contained in:
parent
2f1cb7ef3b
commit
554cce0c4c
@ -171,13 +171,12 @@ sub read_subscription {
|
||||
my $age = time() - $localinfo->{checktime};
|
||||
|
||||
my $maxage = ($localkeydays + $allowcheckfaildays)*60*60*24;
|
||||
if ($localinfo->{status} eq 'Active' && $age > $maxage) {
|
||||
$localinfo->{status} = 'Invalid';
|
||||
$localinfo->{message} = "subscription info too old";
|
||||
}
|
||||
die "subscription info too old\n"
|
||||
if ($localinfo->{status} eq 'Active') && ($age > $maxage);
|
||||
};
|
||||
if (my $err = $@) {
|
||||
warn $err;
|
||||
chomp $err;
|
||||
$info->{message} = $err;
|
||||
} else {
|
||||
$info = $localinfo;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user