rbd: build cmd: allow "falsy" namespace value also here

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
This commit is contained in:
Thomas Lamprecht
2021-04-09 13:40:13 +02:00
parent 4cf696f66e
commit 92a7826f88

View 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});