Skip to content

Commit 4f523df

Browse files
fix lvol event msg, snapshot add
1 parent 6f1845d commit 4f523df

File tree

3 files changed

+8
-10
lines changed

3 files changed

+8
-10
lines changed

simplyblock_core/controllers/lvol_events.py

+7-7
Original file line numberDiff line numberDiff line change
@@ -17,29 +17,29 @@ def _lvol_event(lvol, message, caused_by, event):
1717
db_object=lvol,
1818
caused_by=caused_by,
1919
message=message,
20-
node_id=lvol.node_id)
20+
node_id=lvol.get_id())
2121

2222

2323
def lvol_create(lvol, caused_by=ec.CAUSED_BY_CLI):
24-
_lvol_event(lvol, f"LVol created: {lvol.get_id()}", caused_by, ec.EVENT_OBJ_CREATED)
24+
_lvol_event(lvol, f"LVol created", caused_by, ec.EVENT_OBJ_CREATED)
2525

2626

2727
def lvol_delete(lvol, caused_by=ec.CAUSED_BY_CLI):
28-
_lvol_event(lvol, f"LVol deleted: {lvol.get_id()}", caused_by, ec.EVENT_OBJ_DELETED)
28+
_lvol_event(lvol, f"LVol deleted", caused_by, ec.EVENT_OBJ_DELETED)
2929

3030

3131
def lvol_status_change(lvol, new_state, old_status, caused_by=ec.CAUSED_BY_CLI):
32-
_lvol_event(lvol, f"LVol {lvol.get_id()} status changed from: {old_status} to: {new_state}", caused_by, ec.EVENT_STATUS_CHANGE)
32+
_lvol_event(lvol, f"LVol status changed from: {old_status} to: {new_state}", caused_by, ec.EVENT_STATUS_CHANGE)
3333

3434

3535
def lvol_migrate(lvol, old_node, new_node, caused_by=ec.CAUSED_BY_CLI):
36-
_lvol_event(lvol, f"LVol {lvol.get_id()} migrated from: {old_node}, \nto {new_node}", caused_by, ec.EVENT_STATUS_CHANGE)
36+
_lvol_event(lvol, f"LVol migrated from: {old_node} to: {new_node}", caused_by, ec.EVENT_STATUS_CHANGE)
3737

3838

3939
def lvol_health_check_change(lvol, new_state, old_status, caused_by=ec.CAUSED_BY_CLI):
40-
_lvol_event(lvol, f"LVol {lvol.get_id()} health check changed from: {old_status} to: {new_state}", caused_by, ec.EVENT_STATUS_CHANGE)
40+
_lvol_event(lvol, f"LVol health check changed from: {old_status} to: {new_state}", caused_by, ec.EVENT_STATUS_CHANGE)
4141

4242

4343
def lvol_io_error_change(lvol, new_state, old_status, caused_by=ec.CAUSED_BY_CLI):
44-
_lvol_event(lvol, f"LVol {lvol.get_id()} IO Error changed from: {old_status} to: {new_state}", caused_by, ec.EVENT_STATUS_CHANGE)
44+
_lvol_event(lvol, f"LVol IO Error changed from: {old_status} to: {new_state}", caused_by, ec.EVENT_STATUS_CHANGE)
4545

simplyblock_core/controllers/snapshot_controller.py

-2
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,6 @@ def add(lvol_id, snapshot_name):
120120
elif sec_node.status == StorageNode.STATUS_DOWN:
121121
msg = f"Secondary node is in down status, can not create snapshot"
122122
logger.error(msg)
123-
lvol.remove(db_controller.kv_store)
124123
return False, msg
125124
else:
126125
# sec node is not online, set primary as leader
@@ -135,7 +134,6 @@ def add(lvol_id, snapshot_name):
135134
# both primary and secondary are not online
136135
msg = f"Host nodes are not online"
137136
logger.error(msg)
138-
lvol.remove(db_controller.kv_store)
139137
return False, msg
140138

141139
if primary_node:

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.8
2+
SIMPLY_BLOCK_VERSION=0.4.9
33

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

0 commit comments

Comments
 (0)