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

update client config to use socket hash #443

Merged
merged 1 commit into from
Nov 20, 2015

Conversation

gsalisbury
Copy link
Contributor

Use a socket hash of bind address and port in the sensu_client_config provider.

@jlambert121
Copy link
Contributor

Thanks! What versions of sensu support the socket hash?

@gsalisbury
Copy link
Contributor Author

@jlambert121 I think since 0.17, going by the documentation - https://sensuapp.org/docs/0.17/clients has it whereas https://sensuapp.org/docs/0.16/clients does not.

Cheers,
George

@jlambert121
Copy link
Contributor

Long enough ago then, thanks. Just wanted to make sure it wasn't a brand new feature.

jlambert121 added a commit that referenced this pull request Nov 20, 2015
update client config to use socket hash
@jlambert121 jlambert121 merged commit bc5e501 into sensu:master Nov 20, 2015

def is_to_s(hash = @is)
hash.keys.sort.map {|key| "#{key} => #{hash[key]}"}.join(", ")
end
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This breaks the puppet run for everyone updating from an old puppet module. Because the "is" variable old doesn't exist and defaultto only works with new resources. Is there a reason why just using the default to_s function of the hash isn't enough?

For example when upgrading to this commit running puppet get this error:
Error: Could not convert change 'socket' to string: undefined methodkeys' for nil:NilClass `

When I change is_to_s to just return hash it then updates cleanly with following log line
Notice: /Stage[main]/Sensu::Client::Config/Sensu_client_config[fqdn]/socket: socket changed '' to {'bind' => '127.0.0.1', 'port' => '3030'}

Actually, I'm pretty sure your is_to_s and should_to_s produces the same formatted input so they are not needed at all.

@zbintliff
Copy link
Contributor

Fix pending in #457

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

Successfully merging this pull request may close these issues.

3 participants