test: rbd: actually use debug helper
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
This commit is contained in:
@ -63,9 +63,11 @@ my $vmid_clone = int($vmid) - 1;
|
|||||||
my $vmid_linked_clone = int($vmid) - 2;
|
my $vmid_linked_clone = int($vmid) - 2;
|
||||||
|
|
||||||
sub jp {
|
sub jp {
|
||||||
return if !$DEBUG;
|
|
||||||
print to_json($_[0], { utf8 => 8, pretty => 1, canonical => 1 }) . "\n";
|
print to_json($_[0], { utf8 => 8, pretty => 1, canonical => 1 }) . "\n";
|
||||||
}
|
}
|
||||||
|
sub dbgvar {
|
||||||
|
jp(@_) if $DEBUG;
|
||||||
|
}
|
||||||
|
|
||||||
sub run_cmd {
|
sub run_cmd {
|
||||||
my ($cmd, $json, $ignore_errors) = @_;
|
my ($cmd, $json, $ignore_errors) = @_;
|
||||||
@ -128,9 +130,9 @@ sub prepare {
|
|||||||
if !$use_existing;
|
if !$use_existing;
|
||||||
|
|
||||||
my $namespaces = run_cmd(['rbd', '-p', ${pool}, 'namespace', 'ls', '--format', 'json'], 1);
|
my $namespaces = run_cmd(['rbd', '-p', ${pool}, 'namespace', 'ls', '--format', 'json'], 1);
|
||||||
|
dbgvar($namespace);
|
||||||
my $ns_found = 0;
|
my $ns_found = 0;
|
||||||
for my $i (@$namespaces) {
|
for my $i (@$namespaces) {
|
||||||
#print Dumper $i;
|
|
||||||
$ns_found = 1 if $i->{name} eq $namespace;
|
$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);
|
my $storages = run_cmd(['pvesh', 'get', 'storage', '--output-format', 'json'], 1);
|
||||||
#print Dumper $storages;
|
dbgvar($storages);
|
||||||
my $rbd_found = 0;
|
my $rbd_found = 0;
|
||||||
my $pool_found = 0;
|
my $pool_found = 0;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user