2
0
mirror of https://github.com/xcat2/confluent.git synced 2025-08-25 20:50:28 +00:00

Correct vgname for hyphenated node names

This commit is contained in:
Jarrod Johnson
2024-03-19 09:41:20 -04:00
parent 5f801e6683
commit 559e88b144

View File

@@ -326,8 +326,9 @@ def install_to_disk(imgpath):
biggestsize = fs['initsize']
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]:
oldvgname = oldvgname.rsplit('-', 1)[0]
oldvgname = oldvgname.rsplit('-', 1)[0].replace('--', '-')
osname = oldvgname.split('_')[0]
nodename = socket.gethostname().split('.')[0]
vgname = '{}_{}'.format(osname, nodename)