[Pkg-puppet-devel] [SCM] Puppet packaging for Debian branch, upstream, updated. 2.6.1rc1-141-gcdb2b90
markus (none)
markus at AVA-351181.
Mon Aug 16 12:48:47 UTC 2010
The following commit has been merged in the upstream branch:
commit 37568bdd3f8cc3514eb9d0bf0eae3302686bc13d
Author: Jesse Wolfe <jes5199 at gmail.com>
Date: Mon Aug 2 20:54:59 2010 -0700
[#4423] class { shouldn't get stored on the namespace stack
The new syntax for instantiating parameterized classes was confusing the
lexer's notion of namespaces.
This is a simple fix to prevent that syntax from polluting the
namespaces.
diff --git a/lib/puppet/parser/lexer.rb b/lib/puppet/parser/lexer.rb
index aa04f17..24999bf 100644
--- a/lib/puppet/parser/lexer.rb
+++ b/lib/puppet/parser/lexer.rb
@@ -483,7 +483,7 @@ class Puppet::Parser::Lexer
yield [final_token.name, token_value]
if @previous_token
- namestack(value) if @previous_token.name == :CLASS
+ namestack(value) if @previous_token.name == :CLASS and value != '{'
if @previous_token.name == :DEFINE
if indefine?
diff --git a/spec/unit/parser/lexer_spec.rb b/spec/unit/parser/lexer_spec.rb
index a85d1b2..bcf49ba 100755
--- a/spec/unit/parser/lexer_spec.rb
+++ b/spec/unit/parser/lexer_spec.rb
@@ -619,6 +619,12 @@ describe "Puppet::Parser::Lexer in the old tests" do
@lexer.namespace.should == "base::sub"
end
+ it "should not put class instantiation on the namespace" do
+ @lexer.string = "class base { class sub { class { mode"
+ @lexer.fullscan
+ @lexer.namespace.should == "base::sub"
+ end
+
it "should correctly handle fully qualified names" do
@lexer.string = "class base { class sub::more {"
@lexer.fullscan
--
Puppet packaging for Debian
More information about the Pkg-puppet-devel
mailing list