Skip to content

Commit cafd624

Browse files
authored
fix(linstorvolumemanager): report unexpected DRBD device path (#100)
Signed-off-by: Ronan Abhamon <ronan.abhamon@vates.tech>
1 parent 4ec3ae6 commit cafd624

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

drivers/linstorvolumemanager.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1007,9 +1007,10 @@ def get_volume_name_from_device_path(self, device_path):
10071007
# - "../xcp-volume-<UUID>/0"
10081008
if device_path.startswith(DRBD_BY_RES_PATH):
10091009
prefix_len = len(DRBD_BY_RES_PATH)
1010-
else:
1011-
assert device_path.startswith('../')
1010+
elif device_path.startswith('../'):
10121011
prefix_len = 3
1012+
else:
1013+
raise LinstorVolumeManagerError('Unexpected device path: `{}`'.format(device_path))
10131014

10141015
res_name_end = device_path.find('/', prefix_len)
10151016
assert res_name_end != -1

0 commit comments

Comments
 (0)