Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing host parameters in foreman_hooks json #43

Closed
domcleal opened this issue May 16, 2017 · 3 comments
Closed

Missing host parameters in foreman_hooks json #43

domcleal opened this issue May 16, 2017 · 3 comments
Labels

Comments

@domcleal
Copy link
Contributor

Copied from http://projects.theforeman.org/issues/19565

Started playing with foreman_hooks and noticed that the json data passed to my hook script is missing host parameters when I create a new host. I started digging through commits and found that if i revert this commit:

theforeman/foreman@94265cf#diff-5ef0189b17a78606adef8f22e909697e

in the app/views/api/v2/hosts/show.json.rabl file it works again.

So, this code (which nowadays is moved to main.json.rabl):

node do |host|
  { :parameters => partial("api/v2/parameters/base", :object => host.host_parameters.authorized) }
end

does not work for me but this do:

child :host_parameters => :parameters do
  extends "api/v2/parameters/base" 
end

I'm running this as administrator in my Foreman installation, am I missing something or is this a bug?

@wiad
Copy link
Contributor

wiad commented May 17, 2017

Alright, now I see my global params. I'm also using the custom_host_parameters plugin but those parameters are not showing up in the json output unfortunately.

@wiad
Copy link
Contributor

wiad commented May 17, 2017

So I get content in the "all_parameters" key, but the "parameters" key is empty:

"parameters":[]

@wiad
Copy link
Contributor

wiad commented Jul 4, 2017

@domcleal Any feedback on how to get the '@parameters' data?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants