Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cmd/flux-kvs: Fix dir -R corner case #1452

Merged
merged 1 commit into from
Apr 12, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion src/cmd/flux-kvs.c
Original file line number Diff line number Diff line change
Expand Up @@ -1118,7 +1118,10 @@ static void dump_kvs_dir (const flux_kvsdir_t *dir, int maxcol,
if (!(f = flux_kvs_lookupat (h, FLUX_KVS_READDIR, key, rootref))
|| flux_kvs_lookup_get_dir (f, &ndir) < 0)
log_err_exit ("%s", key);
dump_kvs_dir (ndir, maxcol, Ropt, dopt);
if (flux_kvsdir_get_size (ndir) == 0)
printf ("%s.\n", key);
else
dump_kvs_dir (ndir, maxcol, Ropt, dopt);
flux_future_destroy (f);
} else
printf ("%s.\n", key);
Expand Down
7 changes: 7 additions & 0 deletions t/t1000-kvs.t
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,13 @@ $DIR.d.
EOF
test_cmp expected output
'
test_expect_success 'kvs: dir -R lists subdir' '
flux kvs dir -R $DIR | sort >output &&
cat >expected <<EOF &&
$DIR.d.
EOF
test_cmp expected output
'
test_expect_success 'kvs: dir -R DIR' '
flux kvs put --json $DIR.a=42 $DIR.b=3.14 $DIR.c=foo $DIR.d=true $DIR.e="[1,3,5]" $DIR.f="{\"a\":42}" &&
flux kvs dir -R $DIR | sort >output &&
Expand Down