Actions
Bug #2550
closedPuppetclass search_by_host doesn't return all classes for an unknown host
Description
Puppetclass.search_for shows up in puppetclasses_controller and its respective method of the API. It uses scoped_search to look for all puppetclasses that a host contains. Unfortunately, in the event of a lookup of a host that either belongs to no hostgroup or a host that doesn't exist, this will return all puppetclasses.
This fix checks for this conditions and avoids returning all puppetclasses.
curl -v -k -H d"Content-Type:application/json" https://foreman/api/hosts/nonexistenthost/puppetclasses returns
Puppetclass.all without this fix,
after this fix it returns {} (no puppet classes, which is correct)
Updated by Ohad Levy over 11 years ago
- Category set to Search
- Target version set to 1.2.0
Updated by Daniel Lobato Garcia over 11 years ago
- Status changed from New to Closed
Applied in changeset 7507fbcede129c219ca1d85e757d2bdd17d5ffb9.
Actions