From c5360bbede525deffd7928003e702c0c6908b2e4 Mon Sep 17 00:00:00 2001 From: Albert Chu Date: Fri, 18 Jan 2019 11:21:39 -0800 Subject: [PATCH 1/2] bindings/python: Add target to put_symlink() Call did not support a symlink target. Fixes #1933 --- src/bindings/python/flux/kvs.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/bindings/python/flux/kvs.py b/src/bindings/python/flux/kvs.py index 4febed8d5246..dcc016cac1fc 100644 --- a/src/bindings/python/flux/kvs.py +++ b/src/bindings/python/flux/kvs.py @@ -96,10 +96,10 @@ def put_unlink(flux_handle, key): return RAW.flux_kvs_txn_unlink(flux_handle.aux_txn, 0, key) -def put_symlink(flux_handle, key): +def put_symlink(flux_handle, key, target): if flux_handle.aux_txn is None: flux_handle.aux_txn = RAW.flux_kvs_txn_create() - return RAW.flux_kvs_txn_symlink(flux_handle.aux_txn, 0, key) + return RAW.flux_kvs_txn_symlink(flux_handle.aux_txn, 0, key, target) def commit(flux_handle, flags=0): From a6bff2a5ef64a515f2a7e0ee51ea316dc47605d8 Mon Sep 17 00:00:00 2001 From: Albert Chu Date: Fri, 18 Jan 2019 11:23:13 -0800 Subject: [PATCH 2/2] t/kvs: Add coverage of missing put transactions --- t/python/t0005-kvs.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/t/python/t0005-kvs.py b/t/python/t0005-kvs.py index 378bdad3bb09..a4f4026fd98b 100755 --- a/t/python/t0005-kvs.py +++ b/t/python/t0005-kvs.py @@ -166,6 +166,23 @@ def test_walk(self): for r, ds, fs in walk_gen: pass + def test_put_mkdir(self): + flux.kvs.put_mkdir(self.f, "txn_mkdir") + flux.kvs.commit(self.f) + self.assertTrue(flux.kvs.exists(self.f, "txn_mkdir")) + + def test_put_unlink(self): + flux.kvs.put(self.f, "txn_unlink", 1) + flux.kvs.commit(self.f) + flux.kvs.put_unlink(self.f, "txn_unlink") + flux.kvs.commit(self.f) + self.assertFalse(flux.kvs.exists(self.f, "txn_unlink")) + + def test_put_symlink(self): + flux.kvs.put_symlink(self.f, "txn_symlink", "txn_target") + flux.kvs.commit(self.f) + self.assertFalse(flux.kvs.exists(self.f, "txn_symlink")) + if __name__ == "__main__": if rerun_under_flux(__flux_size()):