Closed phirince closed 9 years ago
Can somebody please look into this and let me know if this can be pulled up?
-PP
Sorry for not getting to this.
This causes an issue with plain Foreman hooks if you're not using the Discovery plugin, as the constant isn't known. You might want to change the case statement to compare self.class.name
instead, so we're only comparing strings without the need for Host::Discovered to actually exist.
Running hook: /home/dcleal/code/foreman/foreman/config/hooks/domain/before_validation/01_log.sh before_validation Unable to render (Domain) using RABL: uninitialized constant Host::Discovered /home/dcleal/code/foreman/foreman_hooks/lib/foreman_hooks.rb:83:in `load_missing_constant_with_hooks' /home/dcleal/code/foreman/foreman_hooks/lib/foreman_hooks/util.rb:10:in `render_hook_type' /home/dcleal/code/foreman/foreman_hooks/lib/foreman_hooks/util.rb:20:in `render_hook_json' /home/dcleal/code/foreman/foreman_hooks/lib/foreman_hooks/util.rb:31:in `block in exec_hook'
Thanks @phirince!
This is needed so that the discovered_hosts/*.rabl files from the foreman_discovery plugin are available fore rendering. Please review this.
Thanks, -PP