[prev in list] [next in list] [prev in thread] [next in thread] 

List:       puppet-dev
Subject:    [Puppet-dev] Re: [Puppet-commit] puppet revision 1047
From:       luke () madstop ! com (Luke Kanies)
Date:       2006-03-31 19:15:17
Message-ID: Pine.OSX.4.64.0603311910140.2572 () powerbook ! local
[Download RAW message or body]

On Fri, 31 Mar 2006, svn@madstop.com wrote:

> Developer: lutter
> Date: 2006-03-31 17:33:17 -0600 (Fri, 31 Mar 2006)
> Lines: 77
>
> Comment:
> Manifests can now specify node names with fully qualified domain names, too.
>
> Modified Files:
> trunk/lib/puppet/parser/ast/leaf.rb
> trunk/lib/puppet/parser/grammar.ra
> trunk/lib/puppet/parser/interpreter.rb
> trunk/lib/puppet/parser/lexer.rb
> trunk/lib/puppet/parser/parser.rb

trunk/lib/puppet/parser/lexer.rb
r923    r1047 
22  22                  %r{\(} => :LPAREN, 
23  23                  %r{\)} => :RPAREN, 
24                      %r{"} => :DQUOTE,
     24                  %r{\"} => :DQUOTE, 
25  25                  %r{\n} => :RETURN, 
26                      %r{'} => :SQUOTE,
     26                  %r{\'} => :SQUOTE, 
27  27                  %r{=} => :EQUALS, 
28  28                  %r{==} => :ISEQUAL, 
41  41                  %r{[a-z][-\w]*} => :NAME, 
42  42                  %r{[A-Z][-\w]*} => :TYPE,
     43                  %r{[0-9a-zA-Z\-]+\.[0-9a-zA-Z\-.]+} => :HOSTNAME, 
43  44                  %r{[0-9]+} => :NUMBER, 
44  45                  %r{\$\w+} => :VARIABLE

Hmmm; this is a large enough change that it would be nice if there were some
tests in there to verify that it all works.  Specifically, I'm concerned
about the addition of '.' being allowed as an unquoted character.  At least
partially, I'm a little gun-shy because cfengine allows it and uses it for
AND and in file names, and it was pretty much impossible to parse.

I think we should stick to [-\w]+ being the only allowed characters in
unquoted terms, and either way I would like to see some tests that verify
that everything parses correctly and that node lookup also works correctly.

I notice you didn't modify the server or the scope; did they already
correctly look up hosts using short or long names?  Does the scope work to
make sure the config specification and the client hostname specification
match?  Does Puppet try to extra a long name out of the LDAP DN?

Mostly, though, I'm scared by the '.'.

-- 
'Tis better to be silent and be thought a fool, than to speak and
remove all doubt.              --Abraham Lincoln
---------------------------------------------------------------------
Luke Kanies | http://reductivelabs.com | http://madstop.com

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic