puppetlabs-stdlib icon indicating copy to clipboard operation
puppetlabs-stdlib copied to clipboard

has_key deprecated shim.

Open robertc99 opened this issue 2 years ago • 4 comments

As far as I can tell, in version 8.6.0 the has_key function was documented as being deprecated, but didnt produce a deprecated warning. But its been removed in version 9+.

So its gone from working silently to missing with no runtime notification to users. I think it would be better to add a shim with a warning for the moment, so modules have a chance to convert to the "in" operator.

robertc99 avatar Jun 16 '23 02:06 robertc99

Not sure on this one. Unlike the other cases, the replacement isn't something that's introduced in stdlib 9, but something that's been available in Puppet for a very long time.

alexjfisher avatar Jun 27 '23 13:06 alexjfisher

Would it be better to do a version 8.n+1 which emits a deprecation warning?

ekohl avatar Jun 27 '23 13:06 ekohl

I dont think a new version 8 is useful as people upgrading from 8.6.0 are likely to go straight to the latest 9.x without going through a new 8.x.

robertc99 avatar Jun 28 '23 09:06 robertc99

Regardless of whether the replacement has been in puppet for a long time, there are still modules out there using has_key. I think its not a good idea to go straight from working to broken without giving a warning.

robertc99 avatar Jun 28 '23 09:06 robertc99