Problem with empty string parameter not behaving as expected on puppet4.

Bug #1680081 reported by Sofer Athlan-Guyot
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
puppet-vswitch
Medium
Unassigned

Bug Description

Hi,

puppet4 changed the semantic of the empty string.

With puppet3 empty sting meant false, with puppet4 it means true[1]

So now the semantic of this test[2] are false. If you look at [3] then puppet4 will happily creates the parameter:

    "--socket-mem ''"

while puppet3 won't as empty string is false.

Same on [4].

There are some places where this has been taken care of [5] for instance.

The !empty should be added everywhere to make sure we have the same behavior for empty string in puppet3 and in puppet4.

As it happen only when user explicitly passes empty string as parameter, I'm setting this as medium priority, as this behavior is not the "normal" one.

[1] https://docs.puppet.com/puppet/4.9/lang_updating_manifests.html#empty-strings-in-boolean-context-are-true

[2] https://github.com/openstack/puppet-vswitch/blob/master/spec/classes/vswitch_dpdk_spec.rb#L72-L78

[3] https://github.com/openstack/puppet-vswitch/blob/master/manifests/dpdk.pp#L63-L65
[4] https://github.com/openstack/puppet-vswitch/blob/master/manifests/dpdk.pp#L69
[5] https://github.com/openstack/puppet-vswitch/blob/master/manifests/dpdk.pp#L87

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers