]> git.proxmox.com Git - pve-container.git/commitdiff
setup: code reduction
authorThomas Lamprecht <t.lamprecht@proxmox.com>
Wed, 29 Sep 2021 16:16:55 +0000 (18:16 +0200)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Wed, 29 Sep 2021 18:48:51 +0000 (20:48 +0200)
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
src/PVE/LXC/Setup.pm

index b6c5b17187c26be62a7269dfc76c2ed53cfd89d7..ed988fc4f8b31c94309be01ad8e1ee41fcdcdab8 100644 (file)
@@ -254,11 +254,9 @@ sub rewrite_ssh_host_keys {
 
     return if !$self->{plugin}; # unmanaged
 
-    my $conf = $self->{conf};
     my $plugin = $self->{plugin};
-    my $rootdir = $self->{rootdir};
 
-    return if ! -d "$rootdir/etc/ssh";
+    return if ! -d "$self->{rootdir}/etc/ssh";
 
     my $keynames = {
        rsa => 'ssh_host_rsa_key',
@@ -267,7 +265,7 @@ sub rewrite_ssh_host_keys {
        ed25519 => 'ssh_host_ed25519_key',
     };
 
-    my $hostname = $conf->{hostname} || 'localhost';
+    my $hostname = $self->{conf}->{hostname} || 'localhost';
     $hostname =~ s/\..*$//;
 
     my $keyfiles = [];