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

Return node groups from /self/myattribs

groups is stored as a plain list rather than a value dict, so the
value check skipped it and a node could not see its own groups. Return
it as a list, the same way ansible plays get it as host vars.
This commit is contained in:
Markus Hilger
2026-11-11 23:02:02 +01:00
parent 05ec7f9d4d
commit c949359199
+7 -1
View File
@@ -275,7 +275,13 @@ async def handle_request(req, make_response, mimetype):
cfd = cfg.get_node_attributes(nodename, '*', decrypt=True).get(nodename, {})
rsp = {}
for k in cfd:
if k.startswith('secret') or k.startswith('crypt') or 'value' not in cfd[k] or not cfd[k]['value']:
if k.startswith('secret') or k.startswith('crypt'):
continue
if isinstance(cfd[k], list):
if cfd[k]:
rsp[k] = cfd[k]
continue
if 'value' not in cfd[k] or not cfd[k]['value']:
continue
rsp[k] = cfd[k]['value']
if isinstance(rsp[k], bytes):