]> git.proxmox.com Git - pve-cluster.git/commitdiff
datacenter config: refactor ref-checking for serialization
authorThomas Lamprecht <t.lamprecht@proxmox.com>
Thu, 24 Mar 2022 12:09:57 +0000 (13:09 +0100)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Wed, 27 Apr 2022 05:34:46 +0000 (07:34 +0200)
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
data/PVE/DataCenterConfig.pm

index 344b6c7bba4e3c7e1db94f9fe3facc4c72b843d3..42d6ebd99340a3d2b5072358960b543a8157aeb6 100644 (file)
@@ -294,23 +294,19 @@ sub write_datacenter_config {
        $cfg->{console} = 'html5';
     }
 
-    if (ref($cfg->{migration})) {
-       my $migration = $cfg->{migration};
+    if (ref(my $migration = $cfg->{migration})) {
        $cfg->{migration} = PVE::JSONSchema::print_property_string($migration, $migration_format);
     }
 
-    if (ref($cfg->{ha})) {
-       my $ha = $cfg->{ha};
+    if (ref(my $ha = $cfg->{ha})) {
        $cfg->{ha} = PVE::JSONSchema::print_property_string($ha, $ha_format);
     }
 
-    if (ref($cfg->{u2f})) {
-       my $u2f = $cfg->{u2f};
+    if (ref(my $u2f = $cfg->{u2f})) {
        $cfg->{u2f} = PVE::JSONSchema::print_property_string($u2f, $u2f_format);
     }
 
-    if (ref($cfg->{webauthn})) {
-       my $webauthn = $cfg->{webauthn};
+    if (ref(my $webauthn = $cfg->{webauthn})) {
        $cfg->{webauthn} = PVE::JSONSchema::print_property_string($webauthn, $webauthn_format);
     }