2
0
mirror of https://github.com/xcat2/confluent.git synced 2024-11-22 09:32:21 +00:00

Add more clear error on syncfile mistake

If a bad node was included in
a syncfile, the error was highly misleading.

Provide a more clear indicaiton of the problem on failure.
This commit is contained in:
Jarrod Johnson 2023-02-14 14:51:46 -05:00
parent 09ce824c85
commit 90af99e864

View File

@ -98,11 +98,14 @@ class SyncList(object):
v = v.strip()
if ':' in v:
nr, v = v.split(':', 1)
for candidate in noderange.NodeRange(nr, cfg).nodes:
if candidate == nodename:
break
else:
continue
try:
for candidate in noderange.NodeRange(nr, cfg).nodes:
if candidate == nodename:
break
else:
continue
except Exception as e:
raise Exception('Error on syncfile line "{}": {}'.format(ent, str(e)))
optparts = v.split()
v = optparts[0]
optparts = optparts[1:]