PVE/Subscription.pm - avoid warn, and return error message instead
authorDietmar Maurer <dietmar@proxmox.com>
Tue, 3 Oct 2017 10:02:45 +0000 (12:02 +0200)
committerDietmar Maurer <dietmar@proxmox.com>
Tue, 3 Oct 2017 10:55:17 +0000 (12:55 +0200)
src/PVE/Subscription.pm

index 8de1c02..1fa933a 100644 (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;
        }