danofthewired / puppet-bitbucket

Atlassian Bitbucket Puppet Module
MIT License
3 stars 45 forks source link

puppetlabs-stdlib has deprecated validate_string and validate_bool as of version 4.5.0 #85

Open gerg91 opened 8 months ago

gerg91 commented 8 months ago

I was able to get past this in my env, but wanted to pass the fix up to you guys since the it's pretty straightforward. I can submit a PR too if wanted, it should should only require 4 lines to be modified.

My env:

Upon running puppet-bitbucket I get the following:

Error: Could not retrieve catalog from remote server: Error 500 on SERVER: Server Error: Evaluation Error: Unknown function: 'validate_hash'.

I traced this to a deprecation of that function, additionally the function validate_bool has also been deprecated.

The recommended mitigation by puppetlabs-stdlib is to use data types, see here.

To get past this I replaced every instance of validate_hash() with Hash() and every instance of validate_bool() with Boolean(). If either type were malformed assigning them a type will fail, as intended.