test: rbd: actually use debug helper

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
This commit is contained in:
Thomas Lamprecht
2021-04-12 15:26:34 +02:00
parent bef7920d1e
commit 0d7c9ca188

View File

@ -63,9 +63,11 @@ my $vmid_clone = int($vmid) - 1;
my $vmid_linked_clone = int($vmid) - 2;
sub jp {
return if !$DEBUG;
print to_json($_[0], { utf8 => 8, pretty => 1, canonical => 1 }) . "\n";
}
sub dbgvar {
jp(@_) if $DEBUG;
}
sub run_cmd {
my ($cmd, $json, $ignore_errors) = @_;
@ -128,9 +130,9 @@ sub prepare {
if !$use_existing;
my $namespaces = run_cmd(['rbd', '-p', ${pool}, 'namespace', 'ls', '--format', 'json'], 1);
dbgvar($namespace);
my $ns_found = 0;
for my $i (@$namespaces) {
#print Dumper $i;
$ns_found = 1 if $i->{name} eq $namespace;
}
@ -140,7 +142,7 @@ sub prepare {
}
my $storages = run_cmd(['pvesh', 'get', 'storage', '--output-format', 'json'], 1);
#print Dumper $storages;
dbgvar($storages);
my $rbd_found = 0;
my $pool_found = 0;