]> git.proxmox.com Git - pve-apiclient.git/commitdiff
use two-argument bless
authorThomas Lamprecht <t.lamprecht@proxmox.com>
Mon, 30 Nov 2020 14:03:30 +0000 (15:03 +0100)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Mon, 30 Nov 2020 14:27:22 +0000 (15:27 +0100)
else we'd break "inheriting" (or whatever perl does is called) to
child modules

> Never use the one-argument form of bless.
-- Perl Best Practices, Pg. 365

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
PVE/APIClient/LWP.pm

index baf3a680694b0291bb9b00dbc6d9e32584bce0cd..e988033e573a68aab51b118058adc4caab75f0b1 100755 (executable)
@@ -317,7 +317,7 @@ sub new {
        register_fingerprint_cb => $param{register_fingerprint_cb},
        timeout => $param{timeout} || 60,
     };
        register_fingerprint_cb => $param{register_fingerprint_cb},
        timeout => $param{timeout} || 60,
     };
-    bless $self;
+    bless $self, $class;
 
     if (!$ssl_opts->{SSL_verify_callback}) {
        $ssl_opts->{'SSL_verify_mode'} = SSL_VERIFY_PEER;
 
     if (!$ssl_opts->{SSL_verify_callback}) {
        $ssl_opts->{'SSL_verify_mode'} = SSL_VERIFY_PEER;