From 31092290614bcdd67d30e1bdd8b071e4c4cc3a61 Mon Sep 17 00:00:00 2001 From: Linus Vogel Date: Thu, 4 Jun 2026 21:35:45 +0200 Subject: [PATCH] fixed hostgroup create error --- pillar_tool/routers/hostgroup.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pillar_tool/routers/hostgroup.py b/pillar_tool/routers/hostgroup.py index 81beee2..01486de 100644 --- a/pillar_tool/routers/hostgroup.py +++ b/pillar_tool/routers/hostgroup.py @@ -140,10 +140,10 @@ def hostgroup_create(req: Request, name: str, params: HostgroupParams): print("[DEBUG] hostgroup_create: creating hostgroup hierarchy with {} label(s): {}".format(len(labels), labels)) - stmt = select(Host).where(and_(Host.name == bindparam('name'), Host.is_hostgroup == True, Host.parent_id == bindparam('last'))) last = None for label in labels: - result = db.execute(stmt, {'name': label, 'last': last}).fetchall() + stmt = select(Host).where(and_(Host.name == label, Host.is_hostgroup == True, Host.parent_id == last)) + result = db.execute(stmt).fetchall() if len(result) == 1: # simply step down through the hierarchy