PVE/Subscription.pm - avoid warn, and return error message instead

This commit is contained in:
Dietmar Maurer 2017-10-03 12:02:45 +02:00
parent 2f1cb7ef3b
commit 554cce0c4c

View File

@ -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;
}