Skip to content

Commit f228b63

Browse files
committed
Remove load balancing group id from CLI's status for "namesapce add".
Fixes #604 Signed-off-by: Gil Bregman <gbregman@il.ibm.com>
1 parent ef31a65 commit f228b63

File tree

3 files changed

+11
-11
lines changed

3 files changed

+11
-11
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ rbd: error opening image demo_image: (2) No such file or directory
9797
docker-compose run --rm nvmeof-cli --server-address 192.168.13.3 --server-port 5500 subsystem add --subsystem "nqn.2016-06.io.spdk:cnode1"
9898
Adding subsystem nqn.2016-06.io.spdk:cnode1: Successful
9999
docker-compose run --rm nvmeof-cli --server-address 192.168.13.3 --server-port 5500 namespace add --subsystem "nqn.2016-06.io.spdk:cnode1" --rbd-pool rbd --rbd-image demo_image
100-
Adding namespace 1 to nqn.2016-06.io.spdk:cnode1, load balancing group 1: Successful
100+
Adding namespace 1 to nqn.2016-06.io.spdk:cnode1: Successful
101101
docker-compose run --rm nvmeof-cli --server-address 192.168.13.3 --server-port 5500 listener add --subsystem "nqn.2016-06.io.spdk:cnode1" --host-name fbca1a3d3ed8 --traddr 192.168.13.3 --trsvcid 4420
102102
Adding listener 192.168.13.3:4420 to nqn.2016-06.io.spdk:cnode1: Successful
103103
docker-compose run --rm nvmeof-cli --server-address 2001:db8::3 --server-port 5500 listener add --subsystem "nqn.2016-06.io.spdk:cnode1" --host-name fbca1a3d3ed8 --traddr 2001:db8::3 --trsvcid 4420 --adrfam IPV6

control/cli.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1294,7 +1294,7 @@ def ns_add(self, args):
12941294

12951295
if args.format == "text" or args.format == "plain":
12961296
if ret.status == 0:
1297-
out_func(f"Adding namespace {ret.nsid} to {args.subsystem}, load balancing group {args.load_balancing_group}: Successful")
1297+
out_func(f"Adding namespace {ret.nsid} to {args.subsystem}: Successful")
12981298
else:
12991299
err_func(f"{ret.error_message}")
13001300
elif args.format == "json" or args.format == "yaml":

tests/test_cli.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,7 @@ def test_add_namespace(self, caplog, gateway):
247247
assert f"RBD pool junk doesn't exist" in caplog.text
248248
caplog.clear()
249249
cli(["namespace", "add", "--subsystem", subsystem, "--rbd-pool", pool, "--rbd-image", image2, "--uuid", uuid, "--size", "16MiB", "--rbd-create-image", "--load-balancing-group", "1", "--force"])
250-
assert f"Adding namespace 1 to {subsystem}, load balancing group 1: Successful" in caplog.text
250+
assert f"Adding namespace 1 to {subsystem}: Successful" in caplog.text
251251
assert "Allocated cluster name='cluster_context_1_0'" in caplog.text
252252
caplog.clear()
253253
cli(["namespace", "add", "--subsystem", subsystem, "--rbd-pool", pool, "--rbd-image", image2, "--size", "36M", "--rbd-create-image", "--load-balancing-group", "1", "--force"])
@@ -291,7 +291,7 @@ def test_add_namespace(self, caplog, gateway):
291291
assert rc == 2
292292
caplog.clear()
293293
cli(["namespace", "add", "--subsystem", subsystem, "--rbd-pool", pool, "--rbd-image", image, "--block-size", "1024", "--load-balancing-group", "1"])
294-
assert f"Adding namespace 2 to {subsystem}, load balancing group 1: Successful" in caplog.text
294+
assert f"Adding namespace 2 to {subsystem}: Successful" in caplog.text
295295
caplog.clear()
296296
cli(["--format", "json", "namespace", "list", "--subsystem", subsystem, "--nsid", "1"])
297297
assert '"load_balancing_group": 1' in caplog.text
@@ -317,21 +317,21 @@ def test_add_namespace(self, caplog, gateway):
317317
assert f'"load_balancing_group": {anagrpid2}' in caplog.text
318318
caplog.clear()
319319
cli(["namespace", "add", "--subsystem", subsystem, "--rbd-pool", pool, "--rbd-image", image3, "--size", "4GiB", "--rbd-create-image", "--load-balancing-group", "1"])
320-
assert f"Adding namespace 3 to {subsystem}, load balancing group 1: Successful" in caplog.text
320+
assert f"Adding namespace 3 to {subsystem}: Successful" in caplog.text
321321
caplog.clear()
322322
cli(["--format", "json", "namespace", "list", "--subsystem", subsystem, "--nsid", "3"])
323323
assert '"rbd_image_size": "4294967296"' in caplog.text
324324

325325
def test_add_namespace_ipv6(self, caplog, gateway):
326326
caplog.clear()
327327
cli(["--server-address", server_addr_ipv6, "namespace", "add", "--subsystem", subsystem, "--rbd-pool", pool, "--rbd-image", image, "--load-balancing-group", "1","--force"])
328-
assert f"Adding namespace 4 to {subsystem}, load balancing group 1: Successful" in caplog.text
328+
assert f"Adding namespace 4 to {subsystem}: Successful" in caplog.text
329329
assert f'will continue as the "force" argument was used' in caplog.text
330330
caplog.clear()
331331
cli(["--format", "json", "namespace", "list", "--subsystem", subsystem, "--nsid", "3"])
332332
assert '"load_balancing_group": 1' in caplog.text
333333
cli(["--server-address", server_addr_ipv6, "namespace", "add", "--subsystem", subsystem, "--nsid", "8", "--rbd-pool", pool, "--rbd-image", image, "--load-balancing-group", "1", "--force"])
334-
assert f"Adding namespace 8 to {subsystem}, load balancing group 1: Successful" in caplog.text
334+
assert f"Adding namespace 8 to {subsystem}: Successful" in caplog.text
335335
caplog.clear()
336336
cli(["--format", "json", "namespace", "list", "--subsystem", subsystem, "--nsid", "8"])
337337
assert '"load_balancing_group": 1' in caplog.text
@@ -340,7 +340,7 @@ def test_add_namespace_same_image(self, caplog, gateway):
340340
caplog.clear()
341341
img_name = f"{image}_test"
342342
cli(["namespace", "add", "--subsystem", subsystem, "--rbd-pool", pool, "--rbd-image", img_name, "--size", "16MiB", "--load-balancing-group", "1", "--rbd-create-image", "--load-balancing-group", "1"])
343-
assert f"Adding namespace 5 to {subsystem}, load balancing group 1: Successful" in caplog.text
343+
assert f"Adding namespace 5 to {subsystem}: Successful" in caplog.text
344344
caplog.clear()
345345
cli(["namespace", "add", "--subsystem", subsystem, "--rbd-pool", pool, "--rbd-image", img_name, "--size", "16MiB", "--load-balancing-group", "1", "--rbd-create-image", "--load-balancing-group", "1"])
346346
assert f"RBD image {pool}/{img_name} is already used by a namespace" in caplog.text
@@ -351,7 +351,7 @@ def test_add_namespace_same_image(self, caplog, gateway):
351351
assert f"you can find the offending namespace by using" in caplog.text
352352
caplog.clear()
353353
cli(["namespace", "add", "--subsystem", subsystem, "--rbd-pool", pool, "--rbd-image", img_name, "--load-balancing-group", "1", "--force"])
354-
assert f"Adding namespace 6 to {subsystem}, load balancing group 1: Successful" in caplog.text
354+
assert f"Adding namespace 6 to {subsystem}: Successful" in caplog.text
355355
assert f"RBD image {pool}/{img_name} is already used by a namespace" in caplog.text
356356
assert f'will continue as the "force" argument was used' in caplog.text
357357

@@ -435,7 +435,7 @@ def test_resize_namespace(self, caplog, gateway):
435435
assert f"Failure resizing namespace using NSID {nsid} on {subsystem}: Can't find namespace" in caplog.text
436436
caplog.clear()
437437
cli(["namespace", "add", "--subsystem", subsystem, "--nsid", nsid, "--rbd-pool", pool, "--rbd-image", image, "--uuid", uuid, "--force", "--load-balancing-group", "1"])
438-
assert f"Adding namespace 1 to {subsystem}, load balancing group 1: Successful" in caplog.text
438+
assert f"Adding namespace 1 to {subsystem}: Successful" in caplog.text
439439
caplog.clear()
440440
cli(["namespace", "resize", "--subsystem", subsystem, "--nsid", "3", "--size", "6GiB"])
441441
assert f"Resizing namespace 3 in {subsystem} to 6144 MiB: Successful" in caplog.text
@@ -823,7 +823,7 @@ def test_create_subsystem_ana(self, caplog, gateway):
823823
def test_add_namespace_ana(self, caplog, gateway):
824824
caplog.clear()
825825
cli(["namespace", "add", "--subsystem", subsystem, "--rbd-pool", pool, "--rbd-image", image, "--load-balancing-group", anagrpid])
826-
assert f"Adding namespace {nsid} to {subsystem}, load balancing group {anagrpid}: Successful" in caplog.text
826+
assert f"Adding namespace {nsid} to {subsystem}: Successful" in caplog.text
827827
assert "Allocated cluster name='cluster_context_2_0'" in caplog.text
828828
caplog.clear()
829829
cli(["--format", "json", "namespace", "list", "--subsystem", subsystem, "--nsid", nsid])

0 commit comments

Comments
 (0)