[pve-devel] [PATCH v1 pve-common 03/18] pbsclient: use post-if definedness checks instead of '//=' operator
Max Carrara
m.carrara at proxmox.com
Fri Aug 2 15:26:41 CEST 2024
Signed-off-by: Max Carrara <m.carrara at proxmox.com>
---
src/PVE/PBSClient.pm | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/PVE/PBSClient.pm b/src/PVE/PBSClient.pm
index 3e98dd1..525b37f 100644
--- a/src/PVE/PBSClient.pm
+++ b/src/PVE/PBSClient.pm
@@ -208,7 +208,7 @@ my sub run_client_cmd : prototype($$;$$$$) {
my $json_str = '';
my $outfunc = sub { $json_str .= "$_[0]\n" };
- $binary //= 'proxmox-backup-client';
+ $binary = 'proxmox-backup-client' if !defined($binary);
$param = [] if !defined($param);
$param = [ $param ] if !ref($param);
@@ -286,7 +286,7 @@ sub backup_fs_tree {
'--backup-id', $id,
];
- $cmd_opts //= {};
+ $cmd_opts = {} if !defined($cmd_opts);
$cmd_opts->{namespace} = $self->{scfg}->{namespace} if defined($self->{scfg}->{namespace});
@@ -308,7 +308,7 @@ sub restore_pxar {
"$target",
"--allow-existing-dirs", 0,
];
- $cmd_opts //= {};
+ $cmd_opts = {} if !defined($cmd_opts);
$cmd_opts->{namespace} = $namespace;
--
2.39.2
More information about the pve-devel
mailing list