unable to filter on classes
After update to 1.4.0 I can no longer filter host lists based on classes. Regardless of which class i try to filter with, theforeman returns all hosts as a result.
Example of query:
should return one host but returns all hosts.
#2 Updated by Adam Winberg almost 7 years ago
Got this from production.log in debug mode:
Hostgroup Load (0.6ms) SELECT DISTINCT hostgroups.id FROM "hostgroups" INNER JOIN "hostgroup_classes" ON "hostgroup_classes"."hostgroup_id" = "hostgroups"."id" INNER JOIN "puppetclasses" ON "puppetclasses"."id" = "hostgroup_classes"."puppetclass_id" WHERE (puppetclasses.name = 'foreman') ORDER BY hostgroups.label
PGError: ERROR: for SELECT DISTINCT, ORDER BY expressions must appear in select list
LINE 1: ..." WHERE (puppetclasses.name = 'foreman') ORDER BY hostgroups...
The PGError indicates there is something wrong with the query. Adjusting the query to include 'hostgroups.label' in the SELECT gets rid of this error, dont know where in the source this is set though.