Skip to content

Allow some bacula::params::validate parameter values to be undef(ined)#10

Open
mjhennig wants to merge 1 commit into
rharrison10:masterfrom
mjhennig:undef-parameter-validation
Open

Allow some bacula::params::validate parameter values to be undef(ined)#10
mjhennig wants to merge 1 commit into
rharrison10:masterfrom
mjhennig:undef-parameter-validation

Conversation

@mjhennig
Copy link
Copy Markdown

Use undef as default value for bacula::params::validate parameters that are allowed to be (and even checked for being) undefined - rather than using an empty string (''), which seems to override any undefined parameters and thus causes validation to fail.

@rharrison10
Copy link
Copy Markdown
Owner

The main reason these were left as '' by default is the class that feeds the bacula::params::validate class already uses undef as the default. Basically the only way to actually have '' be the actual value to this class is only to call the class directly.

That said, you are right. If the calling class uses undef as the default its only reasonable that the child class use the same as a default. Give me a bit to look closer but I'm already inclined to accept this because, well, logical... :-)

@mjhennig
Copy link
Copy Markdown
Author

mjhennig commented Sep 3, 2014

Thank you! Note, however, that one may also consider leaving the empty string defaults but changing the conditional statements later on - as an alternative to this approach. Though I am not sure which way might be better.

@jyaworski
Copy link
Copy Markdown

I'm running into this now, with puppet 4.

Error: Could not retrieve catalog from remote server: Error 400 on SERVER: Evaluation Error: Error while evaluating a Function Call, "" is not an absolute path. at /etc/puppet/environments/production/modules/bacula/manifests/params/validate.pp:183:5 on node puppet1

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