]> git.proxmox.com Git - pve-manager.git/commitdiff
api: subscription: style cleanups
authorThomas Lamprecht <t.lamprecht@proxmox.com>
Mon, 5 Jun 2023 11:25:17 +0000 (13:25 +0200)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Mon, 5 Jun 2023 17:04:12 +0000 (19:04 +0200)
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
PVE/API2/Subscription.pm

index 5f599e15833c49f21c060feb0f4784b4f45bc61b..dd3ac450595a87e0ee995fc3e6e676d7581642b4 100644 (file)
@@ -82,7 +82,8 @@ sub write_etc_subscription {
 
     my $server_id = PVE::API2Tools::get_hwaddress();
     mkdir "/etc/apt/auth.conf.d";
-    Proxmox::RS::Subscription::write_subscription($filename, "/etc/apt/auth.conf.d/pve.conf", "enterprise.proxmox.com/debian/pve", $info);
+    Proxmox::RS::Subscription::write_subscription(
+        $filename, "/etc/apt/auth.conf.d/pve.conf", "enterprise.proxmox.com/debian/pve", $info);
 }
 
 __PACKAGE__->register_method ({
@@ -152,7 +153,7 @@ __PACKAGE__->register_method ({
        properties => {
            node => get_standard_option('pve-node'),
            force => {
-               description => "Always connect to server, even if we have up to date info inside local cache.",
+               description => "Always connect to server, even if local cache is still valid.",
                type => 'boolean',
                optional => 1,
                default => 0
@@ -219,7 +220,7 @@ __PACKAGE__->register_method ({
 
        my $key = PVE::Tools::trim($param->{key});
 
-       my $info = {
+       my $new_info = {
            status => 'New',
            key => $key,
            checktime => time(),
@@ -230,14 +231,15 @@ __PACKAGE__->register_method ({
 
        check_key($key, $req_sockets);
 
-       write_etc_subscription($info);
+       write_etc_subscription($new_info);
 
        my $dccfg = PVE::Cluster::cfs_read_file('datacenter.cfg');
        my $proxy = $dccfg->{http_proxy};
 
-       $info = Proxmox::RS::Subscription::check_subscription($key, $server_id, "", "Proxmox VE", $proxy);
+       my $checked_info = Proxmox::RS::Subscription::check_subscription(
+           $key, $server_id, "", "Proxmox VE", $proxy);
 
-       write_etc_subscription($info);
+       write_etc_subscription($checked_info);
 
        return undef;
     }});