pbs: restore pxar: add required parameters explicitly in method signature

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
This commit is contained in:
Thomas Lamprecht 2020-11-17 09:39:03 +01:00
parent ad6b323758
commit 8b88b2f6e5

View File

@ -234,13 +234,10 @@ sub backup_tree {
}; };
sub restore_pxar { 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); die "snapshot not provided\n" if !defined($snapshot);
my $pxarname = delete $opts->{pxarname};
die "archive name not provided\n" if !defined($pxarname); die "archive name not provided\n" if !defined($pxarname);
my $target = delete $opts->{target};
die "restore-target not provided\n" if !defined($target); die "restore-target not provided\n" if !defined($target);
my $param = [ my $param = [
@ -249,8 +246,9 @@ sub restore_pxar {
"$target", "$target",
"--allow-existing-dirs", 0, "--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 { sub forget_snapshot {