thecodeteam / puppet-scaleio

A Puppet module for installing, and configuring ScaleIO 2.0x data services components.
Apache License 2.0
20 stars 18 forks source link

Fix string integer comparison failures using Puppet 3.7.4+ #5

Closed patrickkelso closed 9 years ago

patrickkelso commented 9 years ago

The future parser deprecates automatic conversion of strings to integers. https://tickets.puppetlabs.com/browse/PUP-3615 The fix is to use scanf to convert the strings to an array of integers (or in this case, 1 integer). Tested using the EMCCODE vagrant environment.

jonasrosland commented 9 years ago

Great find, thanks for the PR! Looks good to me.

patrickkelso commented 9 years ago

I realised after I went to bed last night that I should wrap it in a case statement to use the old code if running puppet < 3.7.4 and the new code after.

jonasrosland commented 9 years ago

Is there an issue with the new code when using an older version of Puppet? If so, please add that case statement to the PR.

patrickkelso commented 9 years ago

Of course, that's not as easy as it sounds, because how do I compare versions?

I think as you're using the Future Parser that perhaps you just set the minimum version as 3.7.4.

Realistically the Future Parser won't be supported until Puppet 4 anyway, so users aren't losing anything.

jonasrosland commented 9 years ago

Thanks Patrick, much appreciated, we'll merge this now.

patrickkelso commented 9 years ago

Thanks. I do intend on adding some logic if they have older puppet, but like all the really cool things, I'll probably not have time until the weekend.