[Pkg-puppet-devel] [SCM] Puppet packaging for Debian branch, upstream, updated. 0.25.5-639-g8f94f35

test branch puppet-dev at googlegroups.com
Wed Jul 14 10:34:54 UTC 2010


The following commit has been merged in the upstream branch:
commit 938fbe914a811b10146f817368883df8180ef224
Author: Luke Kanies <luke at puppetlabs.com>
Date:   Wed May 19 23:13:36 2010 -0700

    Removing obsolete nodescope concept
    
    Signed-off-by: Luke Kanies <luke at puppetlabs.com>

diff --git a/lib/puppet/parser/scope.rb b/lib/puppet/parser/scope.rb
index c974aee..bb548dd 100644
--- a/lib/puppet/parser/scope.rb
+++ b/lib/puppet/parser/scope.rb
@@ -19,7 +19,7 @@ class Puppet::Parser::Scope
     include Enumerable
     include Puppet::Util::Errors
     attr_accessor :level, :source, :resource
-    attr_accessor :base, :keyword, :nodescope
+    attr_accessor :base, :keyword
     attr_accessor :top, :translated, :compiler
     attr_accessor :parent
     attr_reader :namespaces
@@ -176,13 +176,6 @@ class Puppet::Parser::Scope
     # the scope in which it was evaluated, so that we can look it up later.
     def class_set(name, scope)
         return parent.class_set(name,scope) if parent
-        if existing = @class_scopes[name]
-            if existing.nodescope? != scope.nodescope?
-                raise Puppet::ParseError, "Cannot have classes, nodes, or definitions with the same name"
-            else
-                raise Puppet::DevError, "Somehow evaluated %s %s twice" % [ existing.nodescope? ? "node" : "class", name]
-            end
-        end
         @class_scopes[name] = scope
     end
 
@@ -298,14 +291,6 @@ class Puppet::Parser::Scope
         compiler.newscope(self, options)
     end
 
-    # Is this class for a node?  This is used to make sure that
-    # nodes and classes with the same name conflict (#620), which
-    # is required because of how often the names are used throughout
-    # the system, including on the client.
-    def nodescope?
-        self.nodescope
-    end
-
     def parent_module_name
         return nil unless @parent
         return nil unless @parent.source
diff --git a/spec/unit/parser/scope.rb b/spec/unit/parser/scope.rb
index 4f30ff0..b665ebd 100755
--- a/spec/unit/parser/scope.rb
+++ b/spec/unit/parser/scope.rb
@@ -43,25 +43,6 @@ describe Puppet::Parser::Scope do
         @scope.parent_module_name.should be_nil
     end
 
-    # #620 - Nodes and classes should conflict, else classes don't get evaluated
-    describe "when evaluating nodes and classes with the same name (#620)" do
-
-        before do
-            @node = stub :nodescope? => true
-            @class = stub :nodescope? => false
-        end
-
-        it "should fail if a node already exists with the same name as the class being evaluated" do
-            @scope.class_set("one", @node)
-            lambda { @scope.class_set("one", @class) }.should raise_error(Puppet::ParseError)
-        end
-
-        it "should fail if a class already exists with the same name as the node being evaluated" do
-            @scope.class_set("one", @class)
-            lambda { @scope.class_set("one", @node) }.should raise_error(Puppet::ParseError)
-        end
-    end
-
     it "should get its environment from its compiler" do
         env = stub 'environment'
         compiler = stub 'compiler', :environment => env

-- 
Puppet packaging for Debian



More information about the Pkg-puppet-devel mailing list