]> git.proxmox.com Git - pve-cluster.git/commitdiff
setup: gen pve cert: code-style & indentation fixes
authorThomas Lamprecht <t.lamprecht@proxmox.com>
Fri, 5 Nov 2021 13:27:04 +0000 (14:27 +0100)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Fri, 5 Nov 2021 13:27:04 +0000 (14:27 +0100)
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
data/PVE/Cluster/Setup.pm

index 1f064775af3cc4b2ac12a59d7d8abb7283f4b998..82efebf482a91da17a90d243d80377c6913b101b 100644 (file)
@@ -461,12 +461,11 @@ sub gen_pve_ssl_cert {
 
     $names .= ",IP:$ip";
 
-    my $fqdn = $nodename;
-
     $names .= ",DNS:$nodename";
 
+    my $fqdn = $nodename;
     if ($rc && $rc->{search}) {
-       $fqdn = $nodename . "." . $rc->{search};
+       $fqdn .= ".$rc->{search}";
        $names .= ",DNS:$fqdn";
     }
 
@@ -502,8 +501,9 @@ __EOD
 
     my $pvessl_key_fn = "$pmxcfs_base_dir/nodes/$nodename/pve-ssl.key";
     eval {
-       run_silent_cmd(['openssl', 'req', '-batch', '-new', '-config', $cfgfn,
-                       '-key', $pvessl_key_fn, '-out', $reqfn]);
+       run_silent_cmd([
+           'openssl', 'req', '-batch', '-new', '-config', $cfgfn, '-key', $pvessl_key_fn, '-out', $reqfn
+       ]);
     };
 
     if (my $err = $@) {
@@ -532,11 +532,11 @@ __EOD
     }
 
     eval {
-       # wrap openssl with faketime to prevent bug #904
-       run_silent_cmd(['faketime', 'yesterday', 'openssl', 'x509', '-req',
-                       '-in', $reqfn, '-days', $daysleft, '-out', $pvessl_cert_fn,
-                       '-CAkey', $pveca_key_fn, '-CA', $pveca_cert_fn,
-                       '-CAserial', $pveca_srl_fn, '-extfile', $cfgfn]);
+       run_silent_cmd([
+           'faketime', 'yesterday', # NOTE: wrap openssl with faketime to prevent bug #904
+           'openssl', 'x509', '-req', '-in', $reqfn, '-days', $daysleft, '-out', $pvessl_cert_fn,
+           '-CAkey', $pveca_key_fn, '-CA', $pveca_cert_fn, '-CAserial', $pveca_srl_fn, '-extfile', $cfgfn
+       ]);
     };
 
     if (my $err = $@) {