]> git.proxmox.com Git - pve-storage.git/blobdiff - PVE/Storage/RBDPlugin.pm
rbd: build cmd: allow "falsy" namespace value also here
[pve-storage.git] / PVE / Storage / RBDPlugin.pm
index 58225c69a4d1a2fc3a0323907ce168b05c8803bd..9e85abfabbe990325da0e854951e434c7b1e0b09 100644 (file)
@@ -39,14 +39,13 @@ my $build_cmd = sub {
 
     my $cmd = [$binary, '-p', $pool];
 
-    # some subcommands will fail if the --namespace parameter is present
-    my $no_namespace_parameter = {
-       unmap => 1,
-    };
-
-    push @$cmd, '--namespace', $scfg->{namespace}
-       if ($scfg->{namespace} && !$no_namespace_parameter->{$op});
-
+    if (defined(my $namespace = $scfg->{namespace})) {
+       # some subcommands will fail if the --namespace parameter is present
+       my $no_namespace_parameter = {
+           unmap => 1,
+       };
+       push @$cmd, '--namespace', "$namespace" if !$no_namespace_parameter->{$op};
+    }
     push @$cmd, '-c', $cmd_option->{ceph_conf} if ($cmd_option->{ceph_conf});
     push @$cmd, '-m', $cmd_option->{mon_host} if ($cmd_option->{mon_host});
     push @$cmd, '--auth_supported', $cmd_option->{auth_supported} if ($cmd_option->{auth_supported});