Re: [Puppet Users] Logrotate module broken, string 'undef' now treated as undef

2016-05-22 Thread Henrik Lindberg

On 18/05/16 23:33, Daniel Urist wrote:

I have been using the yo61 logrotate module from puppetforge
(https://forge.puppet.com/yo61/logrotate), which seems to be the most
popular, but it recently stopped working, with many errors about
undefined parameters.

The issue seems to be the use of the string 'undef' as a default value;
for example:

define logrotate::rule(
$create_owner   = 'undef',


Later on in the code, there are comparisons against the actual string
'undef'; for example:


  if ($create_owner != 'undef') and ($create_mode == 'undef') {
fail("Logrotate::Rule[${name}]: create_owner requires create_mode")
   }


Regardless of whether this is best practice, these comparisons are now
failing, apparently because the string 'undef' is now treated as the
value undef. I've confirmed this by printing the string with notify
(prints nothing when it's 'undef'), and changing it to something else,
which does print.

I'm not sure exactly when this changed or if it's intended behavior or a
bug, but it does seem odd that now apparently 'undef' === undef




The bug logged ended up being PUP-6336
It is indeed a bug, a bad regression caused by a series of surprising 
details (which you can read about on the ticket 
https://tickets.puppetlabs.com/browse/PUP-6336


There is a fix for this that is just merged, and it will be released in 
Puppet 4.5.1 (which will be released much sooner because of this bug).


- henrik

--

Visit my Blog "Puppet on the Edge"
http://puppet-on-the-edge.blogspot.se/

--
You received this message because you are subscribed to the Google Groups "Puppet 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/c51fd813-353d-4cc9-ce70-a16e15e5f71c%40puppet.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] Logrotate module broken, string 'undef' now treated as undef

2016-05-19 Thread Daniel Urist
Here's some code to try:

  $var1 = undef
  $var2 = "undef"
  $var3 = 'undef'
  $var4 = "'undef'"
  $var5 = '"undef"'
  notify { "VAR1: ${var1} VAR2: ${var2} VAR3: ${var3} VAR4: ${var4} VAR5:
${var5}": }

When run, this results in:

  Notice: VAR1:  VAR2:  VAR3:  VAR4: 'undef' VAR5: "undef"

On Thu, May 19, 2016 at 8:30 AM, Daniel Urist  wrote:

> puppetserver: 2.3.2-1puppetlabs1
> puppet client: 3.8.5-2~bpo8+1
>
> Both server and clients are running Debian 8 (jessie); the puppet client
> is from the Debian backports repo.
>
> On Wed, May 18, 2016 at 3:40 PM, Matthaus Owens 
> wrote:
>
>> Daniel,
>> Which version of Puppet are you seeing this on?
>>
>> On Wed, May 18, 2016 at 2:33 PM, Daniel Urist  wrote:
>>
>>> I have been using the yo61 logrotate module from puppetforge (
>>> https://forge.puppet.com/yo61/logrotate), which seems to be the most
>>> popular, but it recently stopped working, with many errors about undefined
>>> parameters.
>>>
>>> The issue seems to be the use of the string 'undef' as a default value;
>>> for example:
>>>
>>> define logrotate::rule(
 $create_owner   = 'undef',

>>>
>>> Later on in the code, there are comparisons against the actual string
>>> 'undef'; for example:
>>>
>>>
>>>   if ($create_owner != 'undef') and ($create_mode == 'undef') {
 fail("Logrotate::Rule[${name}]: create_owner requires create_mode")
}
>>>
>>>
>>> Regardless of whether this is best practice, these comparisons are now
>>> failing, apparently because the string 'undef' is now treated as the value
>>> undef. I've confirmed this by printing the string with notify (prints
>>> nothing when it's 'undef'), and changing it to something else, which does
>>> print.
>>>
>>> I'm not sure exactly when this changed or if it's intended behavior or a
>>> bug, but it does seem odd that now apparently 'undef' === undef
>>>
>>> --
>>> You received this message because you are subscribed to the Google
>>> Groups "Puppet Users" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
>>> an email to puppet-users+unsubscr...@googlegroups.com.
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/puppet-users/CAEo6%3DKYjAx286r9NNvKtGU3PscrAZ77H5_HXc9CXO1LLa552sg%40mail.gmail.com
>>> 
>>> .
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Puppet Users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to puppet-users+unsubscr...@googlegroups.com.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/puppet-users/CACD%3DwAcwR0OdVsPguNNzzeqZ_LUHMoLhAyhTJP56bAZDc0J6Jw%40mail.gmail.com
>> 
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/CAEo6%3DKZ-Ayz5pz%3Djs-EdO8%2BbkP7seQjKNBL-NSKjCnFzdhSavQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] Logrotate module broken, string 'undef' now treated as undef

2016-05-19 Thread Daniel Urist
puppetserver: 2.3.2-1puppetlabs1
puppet client: 3.8.5-2~bpo8+1

Both server and clients are running Debian 8 (jessie); the puppet client is
from the Debian backports repo.

On Wed, May 18, 2016 at 3:40 PM, Matthaus Owens  wrote:

> Daniel,
> Which version of Puppet are you seeing this on?
>
> On Wed, May 18, 2016 at 2:33 PM, Daniel Urist  wrote:
>
>> I have been using the yo61 logrotate module from puppetforge (
>> https://forge.puppet.com/yo61/logrotate), which seems to be the most
>> popular, but it recently stopped working, with many errors about undefined
>> parameters.
>>
>> The issue seems to be the use of the string 'undef' as a default value;
>> for example:
>>
>> define logrotate::rule(
>>> $create_owner   = 'undef',
>>>
>>
>> Later on in the code, there are comparisons against the actual string
>> 'undef'; for example:
>>
>>
>>   if ($create_owner != 'undef') and ($create_mode == 'undef') {
>>> fail("Logrotate::Rule[${name}]: create_owner requires create_mode")
>>>}
>>
>>
>> Regardless of whether this is best practice, these comparisons are now
>> failing, apparently because the string 'undef' is now treated as the value
>> undef. I've confirmed this by printing the string with notify (prints
>> nothing when it's 'undef'), and changing it to something else, which does
>> print.
>>
>> I'm not sure exactly when this changed or if it's intended behavior or a
>> bug, but it does seem odd that now apparently 'undef' === undef
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Puppet Users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to puppet-users+unsubscr...@googlegroups.com.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/puppet-users/CAEo6%3DKYjAx286r9NNvKtGU3PscrAZ77H5_HXc9CXO1LLa552sg%40mail.gmail.com
>> 
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>
> --
> You received this message because you are subscribed to the Google Groups
> "Puppet Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to puppet-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/puppet-users/CACD%3DwAcwR0OdVsPguNNzzeqZ_LUHMoLhAyhTJP56bAZDc0J6Jw%40mail.gmail.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/CAEo6%3DKa5FpwNDBXfnEACFUD0_%3Dm2efTJEnCiheN7sNhnxxEEVg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Puppet Users] Logrotate module broken, string 'undef' now treated as undef

2016-05-18 Thread Matthaus Owens
Daniel,
Which version of Puppet are you seeing this on?

On Wed, May 18, 2016 at 2:33 PM, Daniel Urist  wrote:

> I have been using the yo61 logrotate module from puppetforge (
> https://forge.puppet.com/yo61/logrotate), which seems to be the most
> popular, but it recently stopped working, with many errors about undefined
> parameters.
>
> The issue seems to be the use of the string 'undef' as a default value;
> for example:
>
> define logrotate::rule(
>> $create_owner   = 'undef',
>>
>
> Later on in the code, there are comparisons against the actual string
> 'undef'; for example:
>
>
>   if ($create_owner != 'undef') and ($create_mode == 'undef') {
>> fail("Logrotate::Rule[${name}]: create_owner requires create_mode")
>>}
>
>
> Regardless of whether this is best practice, these comparisons are now
> failing, apparently because the string 'undef' is now treated as the value
> undef. I've confirmed this by printing the string with notify (prints
> nothing when it's 'undef'), and changing it to something else, which does
> print.
>
> I'm not sure exactly when this changed or if it's intended behavior or a
> bug, but it does seem odd that now apparently 'undef' === undef
>
> --
> You received this message because you are subscribed to the Google Groups
> "Puppet Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to puppet-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/puppet-users/CAEo6%3DKYjAx286r9NNvKtGU3PscrAZ77H5_HXc9CXO1LLa552sg%40mail.gmail.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/CACD%3DwAcwR0OdVsPguNNzzeqZ_LUHMoLhAyhTJP56bAZDc0J6Jw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.