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

Drop deprecated hiera_hash() #777

Closed
XMol opened this issue Jul 26, 2021 · 2 comments
Closed

Drop deprecated hiera_hash() #777

XMol opened this issue Jul 26, 2021 · 2 comments

Comments

@XMol
Copy link

XMol commented Jul 26, 2021

Affected Puppet, Ruby, OS and module versions/distributions

  • Puppet: 5.5+
  • Ruby: any
  • Distribution: any
  • Module version: 7.0.0+

How to reproduce (e.g Puppet code you use)

include zabbix::userparameter

What are you seeing

A warning logged by the Puppet master:

Warning: The function 'hiera_hash' is deprecated in favor of using 'lookup'. See https://puppet.com/docs/puppet/5.5/deprecated_language.html\n (file & line not available)

What behaviour did you expect instead

No warning.

Any additional information you'd like to impart

Since this module already demands Puppet to be of version 5.5+ since release '7.0.0', the hiera_hash() in line 34 of userparameter.pp should be replaced by lookup(). E.g. like this:

$_data = lookup('zabbix::userparameter::data', Hash[String[1], Hash[String[1], Scalar]], undef, {})
create_resources('zabbix::userparameters', $_data)

Whether you want to apply any merge behaviour here might be debatable. But in any case, sysadmins may override that in Hiera if needed.

@alexjfisher
Copy link
Member

It looks as if hiera_hash was used specifically to get merge behaviour. Since this can now be set in module hiera data lookup_options, I don't think we need to have an explicit call to lookup.

@XMol
Copy link
Author

XMol commented Jul 26, 2021

True, lookup() isn't strictly necessary. Though that would be the easiest fix. So far there is no hiera.yaml yet, thus this would be the first use case for it and pre-defined lookup behaviour for this module.

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 a pull request may close this issue.

2 participants