X-Git-Url: https://git.proxmox.com/?p=pve-common.git;a=blobdiff_plain;f=src%2FPVE%2FSubscription.pm;h=15711524f570bb9bd5643a3de3463b55004d38ad;hp=8de1c027965064e501bcaadfbbc13bd329c92072;hb=e97f807c388c10250f442b1f16c5315df2ffc2af;hpb=2f1cb7ef3b3368347aaea0583b806c6eedd5b2a2 diff --git a/src/PVE/Subscription.pm b/src/PVE/Subscription.pm index 8de1c02..1571152 100644 --- a/src/PVE/Subscription.pm +++ b/src/PVE/Subscription.pm @@ -154,7 +154,7 @@ sub read_subscription { $data .= $line; } - if ($csum && $data) { + if ($key && $csum && $data) { chomp $csum; @@ -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; }