]> git.proxmox.com Git - pve-cluster.git/blobdiff - data/PVE/DataCenterConfig.pm
datacenter config: refactor ref-checking for serialization
[pve-cluster.git] / 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);
     }