From 3aa90d6b57ae072517787f4b5b3c7f073db2806f Mon Sep 17 00:00:00 2001 From: David Johnson Date: Fri, 23 May 2008 17:26:00 +0000 Subject: [PATCH] "Have the bootinfo server query check if a 'nobootinfo' node_type_attribute is set for any nodes matching the requesting IP." or "Fun with sql." --- pxe/bootinfo_mysql.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/pxe/bootinfo_mysql.c b/pxe/bootinfo_mysql.c index f70cb36cf..5dcf21247 100644 --- a/pxe/bootinfo_mysql.c +++ b/pxe/bootinfo_mysql.c @@ -102,7 +102,14 @@ query_bootinfo_db(struct in_addr ipaddr, int version, boot_what_t *info) " n.next_boot_osid=pnext.osid " "left join os_info as onext on " " onext.osid=n.next_boot_osid " - "where i.IP='%s'", 16, inet_ntoa(ipaddr)); + "left outer join " + " (select type,attrvalue from node_type_attributes " + " where attrkey='nobootinfo' and attrvalue='1' " + " group by type) as nobootinfo_types " + " on n.type=nobootinfo_types.type " + "where i.IP='%s' " + " and nobootinfo_types.attrvalue is NULL", + 16, inet_ntoa(ipaddr)); if (!res) { error("Query failed for host %s\n", ipstr); -- GitLab