]> git.proxmox.com Git - pve-storage.git/commitdiff
test: rbd: actually use debug helper
authorThomas Lamprecht <t.lamprecht@proxmox.com>
Mon, 12 Apr 2021 13:26:34 +0000 (15:26 +0200)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Mon, 12 Apr 2021 13:27:23 +0000 (15:27 +0200)
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
test/rbd_namespace.pl

index 1609d76140bec35fe45a06df375c90f3e8327ffb..0a1d02670b578c5653c7d094097e3887f84c9254 100755 (executable)
@@ -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;