theforeman / foreman_hooks

Run custom hook scripts on Foreman events
http://m0dlx.com/blog/Extending_Foreman_quickly_with_hook_scripts.html
GNU General Public License v3.0
56 stars 50 forks source link

render_hook_json: Use absolute path to views #29

Closed jameslikeslinux closed 8 years ago

jameslikeslinux commented 8 years ago

Under Katello, foreman_hooks is loaded under the foreman-tasks process which is separate from the main foreman process and has a different working directory. The result is that when hooks run from jobs executed by foreman-tasks, they raise an exception when rendering the hook json due to not being able to find the views.

Fix that by specifying an absolute path to the views, based on the Rails root.

Fixes #28

jameslikeslinux commented 8 years ago

This fix, if acceptable, would also have to be applied to #17.

domcleal commented 8 years ago

Thanks @MrStaticVoid!