Closed phirince closed 9 years ago
The rabl files are available inside the app/views directory of foreman_discovery gem. But it is named discovered_hosts and not host/discovereds. But in order for the Rabl module to find this, patches are needed in foreman_discovery, foreman and foreman_hooks. I'll submit pull requests to these. Please review them and let me know any better solution is available.
-PP
These are the pull requests I made in foreman and foreman_discovery
Looks like a good direction, thanks for the PRs - comments on them!
I'm trying to run a hook fore after_save event of Host::Discoverd object.
I'm getting the following error: 2015-08-07 07:58:28 [W] Unable to render mac002128a5131e (Host::Discovered) using RABL: Cannot find rabl template 'api/v2/host/discovereds/show' within registered (["app/views", "/usr/share/foreman/app/views"]) view paths!
this line of code assumes that there is a rabl file for the host object. Only that in this case, the object is not of Host::Managed class. Since foreman_discovery is a plugin, it doesn't make sense to ship the rabl file with the foreman code. https://github.com/theforeman/foreman_hooks/blob/master/lib/foreman_hooks/util.rb#L18https://github.com/theforeman/foreman_hooks/blob/master/lib/foreman_hooks/util.rb#L18
What could be the best solution in this case?
-PP