Skip to content

Commit dd937a7

Browse files
fix SFAM-1701 _1
1 parent 4786269 commit dd937a7

File tree

2 files changed

+4
-21
lines changed

2 files changed

+4
-21
lines changed

simplyblock_core/controllers/lvol_controller.py

+3-20
Original file line numberDiff line numberDiff line change
@@ -1261,6 +1261,9 @@ def resize_lvol(id, new_size):
12611261
logger.error(msg)
12621262
error = True
12631263

1264+
if error:
1265+
return False
1266+
12641267
if primary_node:
12651268

12661269
rpc_client = RPCClient(primary_node.mgmt_ip, primary_node.rpc_port, primary_node.rpc_username,
@@ -1281,32 +1284,12 @@ def resize_lvol(id, new_size):
12811284
sec_rpc_client = RPCClient(secondary_node.mgmt_ip, secondary_node.rpc_port, secondary_node.rpc_username,
12821285
secondary_node.rpc_password)
12831286

1284-
if not is_node_leader(secondary_node, lvol.lvs_name):
1285-
rpc_client.bdev_lvol_set_leader(False, lvs_name=lvol.lvs_name)
1286-
12871287
ret = sec_rpc_client.bdev_lvol_resize(f"{lvol.lvs_name}/{lvol.lvol_bdev}", size_in_mib)
12881288
if not ret:
12891289
logger.error(f"Error resizing lvol on node: {sec_node.get_id()}")
12901290
error = True
12911291

12921292

1293-
if snode.status == StorageNode.STATUS_ONLINE:
1294-
rpc_client = RPCClient(
1295-
snode.mgmt_ip, snode.rpc_port, snode.rpc_username, snode.rpc_password)
1296-
for iface in snode.data_nics:
1297-
if iface.ip4_address:
1298-
ret = rpc_client.nvmf_subsystem_listener_set_ana_state(
1299-
lvol.nqn, iface.ip4_address, lvol.subsys_port, True)
1300-
1301-
sec_node = db_controller.get_storage_node_by_id(snode.secondary_node_id)
1302-
if sec_node and sec_node.status == StorageNode.STATUS_ONLINE:
1303-
sec_node_rpc_client = RPCClient(
1304-
sec_node.mgmt_ip, sec_node.rpc_port, sec_node.rpc_username, sec_node.rpc_password)
1305-
for iface in sec_node.data_nics:
1306-
if iface.ip4_address:
1307-
ret = sec_node_rpc_client.nvmf_subsystem_listener_set_ana_state(
1308-
lvol.nqn, iface.ip4_address, lvol.subsys_port, False)
1309-
13101293
if not error:
13111294
lvol = db_controller.get_lvol_by_id(id)
13121295
lvol.size = new_size

simplyblock_core/env_var

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
SIMPLY_BLOCK_COMMAND_NAME=sbcli-down
2-
SIMPLY_BLOCK_VERSION=0.4.5
2+
SIMPLY_BLOCK_VERSION=0.4.6
33

44
SIMPLY_BLOCK_DOCKER_IMAGE=public.ecr.aws/simply-block/simplyblock:down
55
DOCKER_USER=hamdysimplyblock

0 commit comments

Comments
 (0)