2
0
mirror of https://github.com/xcat2/confluent.git synced 2025-08-31 15:28:17 +00:00

Handle underscore in volume name

Only the first underscore would be in the volume groub name,
the rest would be a part of the volume name, which should be
excluded.
This commit is contained in:
Jarrod Johnson
2025-06-11 08:00:58 -04:00
parent 7dd5c36e78
commit 071433a60a

View File

@@ -373,7 +373,7 @@ def install_to_disk(imgpath):
if fs['device'].startswith('/dev/mapper'):
oldvgname = fs['device'].rsplit('/', 1)[-1]
# if node has - then /dev/mapper will double up the hypen
if '_' in oldvgname and '-' in oldvgname.split('_')[-1]:
if '_' in oldvgname and '-' in oldvgname.split('_', 1)[-1]:
oldvgname = oldvgname.rsplit('-', 1)[0].replace('--', '-')
osname = oldvgname.split('_')[0]
nodename = socket.gethostname().split('.')[0]