From: Thomas Lamprecht Date: Tue, 17 Nov 2020 08:39:03 +0000 (+0100) Subject: pbs: restore pxar: add required parameters explicitly in method signature X-Git-Url: https://git.proxmox.com/?p=pve-common.git;a=commitdiff_plain;h=8b88b2f6e5d945be450f19b517bde13deed7b69d pbs: restore pxar: add required parameters explicitly in method signature Signed-off-by: Thomas Lamprecht --- diff --git a/src/PVE/PBSClient.pm b/src/PVE/PBSClient.pm index de492c9..1d5d111 100644 --- a/src/PVE/PBSClient.pm +++ b/src/PVE/PBSClient.pm @@ -234,13 +234,10 @@ sub backup_tree { }; sub restore_pxar { - my ($self, $opts) = @_; + my ($self, $snapshot, $pxarname, $target, $cmd_opts) = @_; - my $snapshot = delete $opts->{snapshot}; die "snapshot not provided\n" if !defined($snapshot); - my $pxarname = delete $opts->{pxarname}; die "archive name not provided\n" if !defined($pxarname); - my $target = delete $opts->{target}; die "restore-target not provided\n" if !defined($target); my $param = [ @@ -249,8 +246,9 @@ sub restore_pxar { "$target", "--allow-existing-dirs", 0, ]; + $cmd_opts //= {}; - return $self->run_raw_client_cmd('restore', $param, %$opts); + return $self->run_raw_client_cmd('restore', $param, %$cmd_opts); }; sub forget_snapshot {