Skip to content

Allow undef return value for dehydrated::file function#43

Merged
bzed merged 1 commit intobzed:masterfrom
Tiacs:undef-fix
Jun 25, 2025
Merged

Allow undef return value for dehydrated::file function#43
bzed merged 1 commit intobzed:masterfrom
Tiacs:undef-fix

Conversation

@Tiacs
Copy link

@Tiacs Tiacs commented Jun 23, 2025

Pull Request (PR) description

While debugging another issue, I came a cross the following evaluation error in dehydrated::file:

Could not retrieve catalog from remote server: Error 500 on SERVER: Server Error: Evaluation Error: Error while evaluating a Resource Statement, Evaluation Error: Error while evaluating a Function Call, value returned from function 'getfile' has wrong type, expects a String value, got Undef (file: /etc/puppetlabs/code/environments/production/modules/dehydrated/manifests/certificate/collect.pp, line: 47, column: 12) (file: /etc/puppetlabs/code/environments/production/modules/dehydrated/manifests/init.pp, line: 292) on XXXXX

While not being the cause of my original issue, this evaluation error prevented me from getting further debugging information, which I needed to fix my problem.

This Pull Request (PR) fixes the following issues

This pull request fixes the return type of dehydrated::file to also accept undef as return value, which is returned in case of an error.

I believe this is the intended behavior, since it matches the remaining code, handling undef in case of an error.

@bzed bzed merged commit 69c646e into bzed:master Jun 25, 2025
2 of 4 checks passed
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.

2 participants

Comments