]> git.proxmox.com Git - pve-container.git/commitdiff
setup: fix calling clone hook with weird params
authorThomas Lamprecht <t.lamprecht@proxmox.com>
Fri, 18 Jun 2021 16:02:21 +0000 (18:02 +0200)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Fri, 18 Jun 2021 16:02:27 +0000 (18:02 +0200)
$clone has no use and what the interface constraints on $conf vs.
$self->{conf} really are is nowhere documented, so just use $conf for
now, to at least use only one thing (and avoid the highly confusing
case where the signature suggests that $conf is used, so when one
would pass a to $self->{conf} unrelated $conf it would not work)

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
src/PVE/LXC/Setup.pm

index bcb995d60f2b3d505c8db2045d9e5eaa14f35e5d..cf72b03cb3dd0ef717f1aa014f6ad193a0e27c84 100644 (file)
@@ -355,13 +355,9 @@ sub pre_start_hook {
 sub post_clone_hook {
     my ($self, $conf) = @_;
 
-    my $clone = 1;
-
-    my $code = sub {
-       $self->{plugin}->post_clone_hook($self->{conf}, $clone);
-    };
-    $self->protected_call($code);
-
+    $self->protected_call(sub {
+       $self->{plugin}->post_clone_hook($conf);
+    });
 }
 
 sub post_create_hook {