2
0
mirror of https://github.com/xcat2/confluent.git synced 2026-01-11 02:22:31 +00:00

Fix collective manager candidates not in nodelist

For switch operations, need to carry over the same logic as other evaluations.
This commit is contained in:
Jarrod Johnson
2025-09-19 19:41:54 -04:00
parent ac7fdb3ef7
commit 184132c398
2 changed files with 9 additions and 3 deletions

View File

@@ -535,7 +535,10 @@ def _full_updatemacmap(configmanager):
if incollective:
candmgrs = cfg.get('collective.managercandidates', {}).get('value', None)
if candmgrs:
candmgrs = noderange.NodeRange(candmgrs, configmanager).nodes
try:
candmgrs = noderange.NodeRange(candmgrs, configmanager).nodes
except Exception:
candmgrs = noderange.NodeRange(candmgrs).nodes
if mycollectivename not in candmgrs:
# do not think about trying to find nodes that we aren't possibly
# supposed to be a manager for in a collective

View File

@@ -29,7 +29,10 @@ def get_switchcreds(configmanager, switches):
continue
candmgrs = switchcfg.get(switch, {}).get('collective.managercandidates', {}).get('value', None)
if candmgrs:
candmgrs = noderange.NodeRange(candmgrs, configmanager).nodes
try:
candmgrs = noderange.NodeRange(candmgrs, configmanager).nodes
except Exception:
candmgrs = noderange.NodeRange(candmgrs).nodes
if collective.get_myname() not in candmgrs:
continue
switchparms = switchcfg.get(switch, {})
@@ -81,4 +84,4 @@ def get_portnamemap(conn):
ifidx, ifname = vb
ifidx = int(str(ifidx).rsplit('.', 1)[1])
ifnamemap[ifidx] = str(ifname)
return ifnamemap
return ifnamemap