On 2014-21-07 8:23, David Schmitt wrote:
On 2014-07-16 17:03, Peter Van Biesen wrote:
Hi,

I just ran into an issue with the future parser. I had following
statement in my manifests :

cron {'zorgregieRapportering':
       command => "/usr/projects/admintools/cronWrap.bash -s
/home/weblogic/JOB/rapporten/zorgregieRapportering.bash",
       ensure => present,
       user => weblogic,
       minute => '00',
       hour => 1,
       weekday => [1-5],
      }

This would work fine with the old parser but no longer works with the
future parser. It gives an error that "-4 is not a valid weekday" .

I was just wondering why it did work in the old parser. Did the old
parser expand this as a range or just assume this to be a string ?

Thanks in advance,

Petet.
PS: I fixed it by putting weekday => '1-5'

The old parser most likely interpreted that as a string, while the new
one correctly recognized it as an arithmetic expression.

Henrik, you might want to look into that ;-)

The current parser treats 1-5 as a bare-word (i.e. a NAME) which results in a String when evaluated. That is deliberately changed in the future parser, NAME can not start with a digit, and can not contain a hyphen/minus. If you in the current parser write 1 - 5 (with spaces), you get the same result as in the future parser (because NAME cannot contain a space).

The source should be changed to '1-5' (as you did) and this will work in both versions. In the future the correct evaluation of [1-5], is [-4] (an array with a negative integer of value 4).

In general, it is important to use the correct notation to get string values, if something looks like a number, then it will be used as a number. If you want a string quote the value.

- 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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/lqj5d1%24q1m%241%40ger.gmane.org.
For more options, visit https://groups.google.com/d/optout.

Reply via email to