Skip to content

future parser converts explicit undef to empty string #568

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

Merged
merged 1 commit into from
Sep 16, 2014

Conversation

edestecd
Copy link
Contributor

With the future parser and puppet 4, explicit undef seems to be converted to blank string for erb templates
This change allows you to continue to omit config options in the main my.cnf

With the future parser and puppet 4, explicit undef seems to be converted to blank string for erb templates
This change allows you to continue to omit config options in the main my.cnf
@edestecd
Copy link
Contributor Author

Not really sure why this is breaking the build in ruby 1.8.7... I tested this code in ruby 1.8.7 locally and had no issues...

@igalic
Copy link
Contributor

igalic commented Sep 16, 2014

i don't know either, but the funny thing is: sometimes you want that.
sometimes mysql key value pairs are only keys, so the value should be undef.

i think there's a jira ticket somewhere for that…

@edestecd
Copy link
Contributor Author

"sometimes mysql key value pairs are only keys"

Yes and setting the value in overrides to true accomplishes this.
However, setting the value to blank string with the existing code (without my modification) does not accomplish this.
You actually get something like this:
key =
which is not valid.

It puts an = and your blank string.
Maybe this elsif was intended to catch the blank case, but it does not:

elsif vi == true or v == ''

It is checking v not vi and v is never blank since per the if above v is a Hash.

@edestecd
Copy link
Contributor Author

I have not found out why undef is being converted to blank string.
It must be the future parser. Or the mysql_deepmerge function.
I do not see any code that could cause this, so it must be the puppet future parser doing it.

igalic added a commit that referenced this pull request Sep 16, 2014
future parser converts explicit undef to empty string
@igalic igalic merged commit 1bd8f56 into puppetlabs:master Sep 16, 2014
@igalic
Copy link
Contributor

igalic commented Sep 16, 2014

ack, ack, ack. i had forgotten about the overrides/true.
also, i just checked, https://travis-ci.org/puppetlabs/puppetlabs-mysql/jobs/35356040 this isn't _your_ code that's failing, it's travis/puppetlabs-mysql in general.
i guess we can ignore that.

@igalic
Copy link
Contributor

igalic commented Sep 16, 2014

s/ignore/keep ignoring/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants