Nigel suggested I posted this here - he likes the idea. I''m constantly getting bitten by small typos in my manifests, eg. when I do something like: $var1 = extlookup(''foo'') $var2 = extlookup(''foo'') # set $var3 true if $var1 is same as $var2 $var3 = ($var1 == $var) puppet allows this, and sets $var3 to false since $var is not the same as $var1 I''d really like puppet to blow-up at this stage and tell me that I''ve used an variable without defining it first. Those familiar with perl will recognise this as "use strict;". Thoughts? R. -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
Randall Hansen
2011-Mar-08 22:41 UTC
Re: [Puppet Users] Proposal: "strict" mode for manifests
On Mar 8, 2011, at 2:37 PM, Robin Bowes wrote:> I''d really like puppet to blow-up at this stage and tell me that I''ve > used an variable without defining it first. Those familiar with perl > will recognise this as "use strict;".++ r -- Randall Hansen • Director of User Experience • randall@puppetlabs.com -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
John Warburton
2011-Mar-09 01:15 UTC
Re: [Puppet Users] Proposal: "strict" mode for manifests
On 9 March 2011 09:37, Robin Bowes <robin-lists@robinbowes.com> wrote:> I''d really like puppet to blow-up at this stage and tell me that I''ve > used an variable without defining it first. Those familiar with perl > will recognise this as "use strict;". >Yes please! There are lots of places where puppet continues where IMHO it should abort. Here are a few I''ve been watching: - syntax errors in config file do not abort daemon: https://projects.puppetlabs.com/issues/4372 - Invalid settings in config blocks should produce a warning - https://projects.puppetlabs.com/issues/5218 - Option to make Puppet fail as soon as a resource fails - https://projects.puppetlabs.com/issues/3933 John -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
Felix Frank
2011-Mar-11 14:29 UTC
Re: [Puppet Users] Proposal: "strict" mode for manifests
On 03/08/2011 11:37 PM, Robin Bowes wrote:> Nigel suggested I posted this here - he likes the idea. > > I''m constantly getting bitten by small typos in my manifests, eg. when I > do something like: > > $var1 = extlookup(''foo'') > $var2 = extlookup(''foo'') > # set $var3 true if $var1 is same as $var2 > $var3 = ($var1 == $var) > > puppet allows this, and sets $var3 to false since $var is not the same > as $var1 > > I''d really like puppet to blow-up at this stage and tell me that I''ve > used an variable without defining it first. Those familiar with perl > will recognise this as "use strict;". > > Thoughts?Do want. :-) -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
On Mar 11, 2011, at 6:29 AM, Felix Frank wrote:> On 03/08/2011 11:37 PM, Robin Bowes wrote: >> Nigel suggested I posted this here - he likes the idea. >> >> I''m constantly getting bitten by small typos in my manifests, eg. when I >> do something like: >> >> $var1 = extlookup(''foo'') >> $var2 = extlookup(''foo'') >> # set $var3 true if $var1 is same as $var2 >> $var3 = ($var1 == $var) >> >> puppet allows this, and sets $var3 to false since $var is not the same >> as $var1 >> >> I''d really like puppet to blow-up at this stage and tell me that I''ve >> used an variable without defining it first. Those familiar with perl >> will recognise this as "use strict;". >> >> Thoughts? > > Do want. :-)+1 I''''d wonder where you change the option though. In the environment level options on the master? Also, I''m thinking you''d also need a syntax that reverses it for looking at facts that might not exist for something like this: non_strict("cpuid") to replace the expression: $cpuid if you don''t know if the fact exists. This might happen if the host''s copy of factor hasn''t been changed in a while and you don''t want puppet to fail to compile the catalog that will update factor. -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
Kevin Beckford
2011-Mar-15 04:41 UTC
Re: [Puppet Users] Proposal: "strict" mode for manifests
This certainly explains a lot. A very good idea, IMO. -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
This is a huge +1 from me On Mon, Mar 14, 2011 at 9:41 PM, Kevin Beckford <lazyweb@gmail.com> wrote:> This certainly explains a lot. A very good idea, IMO. > > -- > You received this message because you are subscribed to the Google Groups > "Puppet Users" group. > To post to this group, send email to puppet-users@googlegroups.com. > To unsubscribe from this group, send email to > puppet-users+unsubscribe@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/puppet-users?hl=en. >-- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
Christian Kauhaus
2011-Mar-15 09:12 UTC
Re: [Puppet Users] Proposal: "strict" mode for manifests
Am 08.03.2011 23:37, schrieb Robin Bowes:> I''d really like puppet to blow-up at this stage and tell me that I''ve > used an variable without defining it first. Those familiar with perl > will recognise this as "use strict;".I would greatly appreciate such a feature. Is there already a ticket to vote? Regards Christian -- Dipl.-Inf. Christian Kauhaus <>< · kc@gocept.com · systems administration gocept gmbh & co. kg · forsterstraße 29 · 06112 halle (saale) · germany http://gocept.com · tel +49 345 1229889 11 · fax +49 345 1229889 1 Zope and Plone consulting and development -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
Felix Frank
2011-Mar-15 10:55 UTC
Re: [Puppet Users] Proposal: "strict" mode for manifests
> I''''d wonder where you change the option though. In the environment level options on the master? Also, I''m thinking you''d also need a syntax that reverses it for looking at facts that might not exist for something like this: > non_strict("cpuid") > to replace the expression: > $cpuid > if you don''t know if the fact exists. This might happen if the host''s copy of factor hasn''t been changed in a while and you don''t want puppet to fail to compile the catalog that will update factor.This is a very good point. It''s not rare to even rely on some facts usually not being present. I''m not a fan of the suggested syntax, though. This escape should be meant to be used for facts only (or are we liking dynamic scoping again?) and thus maybe there should be a fact() function of somesuch. On the other hand, it''s certainly desirable to keep using the good old $factname syntax. As this thread started off with a perl reference, why wouldn''t we want a ''use variables $varname ...'' syntax that declares variables as known without initializing them? Cheers, Felix -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.