-
-
Notifications
You must be signed in to change notification settings - Fork 75
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
Use delete_undef_values() for mount options #39
Conversation
In newer versions of Puppet, undefined variables are actually `undef`, and not an empty string. This causes `gluster::mount` to return a mount option list that looks like: ``` defaults,undef,undef,undef,undef,undef ``` By using stdlib 4.2.0 or newer, we can use the `delete_undef_values()` function. The other alternative would be to explicitly add an `else` block to each possible mount option's `if` to set it to the empty string.
Is stdlib 4.2.0 old enough that this wouldn't require a major version bump? |
That's a good question. I think so. 4.2.0 was released in mid-2014. The biggest question, which I didn't test, is whether older Puppet 3.x releases will properly treat undefined variables ( |
They're different in 3.x, per here. So it would likely be treated as an empty string. |
Off by one, mid-2015 😉. https://tickets.puppetlabs.com/browse/PUP-4718 |
@daenney the 4.2.0 to which I am referring is the version of New commit coming shortly. |
This looks a little janky, but preserves functionality between Puppet 3.x and Puppet 4.x parsers.
Tests are failing. Can you look into it? |
I've run the tests manually on OSX and CentOS 7.1 without problem. On OSX, I used the system Ruby (2.0.0), and on CentOS I used rvm with Ruby 2.2.4p230. Form my CentOS VM:
|
Can you rebase? |
Ping @skpy |
Use `delete_undef_values` rather than create empty-string variables.
@jyaworski merged master, and used |
In newer versions of Puppet, undefined variables are actually
undef
,and not an empty string. This causes
gluster::mount
to return a mountoption list that looks like:
By using stdlib 4.2.0 or newer, we can use the
delete_undef_values()
function.
The other alternative would be to explicitly add an
else
block toeach possible mount option's
if
to set it to the empty string.