summaryrefslogtreecommitdiffstats
path: root/lib/puppet/parser
diff options
context:
space:
mode:
authorluke <luke@980ebf18-57e1-0310-9a29-db15c13687c0>2006-02-27 22:25:59 +0000
committerluke <luke@980ebf18-57e1-0310-9a29-db15c13687c0>2006-02-27 22:25:59 +0000
commit020499c70a69786e24b0136427b87c8967d40690 (patch)
treee4f312d95921d3682f27a0e3be1a663de238d748 /lib/puppet/parser
parent8c821c09eebe117bd8b100b6dc416ded0588b979 (diff)
downloadpuppet-020499c70a69786e24b0136427b87c8967d40690.tar.gz
puppet-020499c70a69786e24b0136427b87c8967d40690.tar.xz
puppet-020499c70a69786e24b0136427b87c8967d40690.zip
Removing all of the autoname code
git-svn-id: https://reductivelabs.com/svn/puppet/trunk@953 980ebf18-57e1-0310-9a29-db15c13687c0
Diffstat (limited to 'lib/puppet/parser')
-rw-r--r--lib/puppet/parser/ast/component.rb10
-rw-r--r--lib/puppet/parser/ast/objectdef.rb23
-rw-r--r--lib/puppet/parser/scope.rb3
3 files changed, 3 insertions, 33 deletions
diff --git a/lib/puppet/parser/ast/component.rb b/lib/puppet/parser/ast/component.rb
index aa29624fd..0ecdb1d02 100644
--- a/lib/puppet/parser/ast/component.rb
+++ b/lib/puppet/parser/ast/component.rb
@@ -10,7 +10,7 @@ class Puppet::Parser::AST
# The class name
@name = :component
- attr_accessor :type, :args, :code, :scope, :autoname, :keyword
+ attr_accessor :type, :args, :code, :scope, :keyword
#def evaluate(scope,hash,objtype,objname)
def evaluate(hash)
@@ -22,8 +22,7 @@ class Puppet::Parser::AST
scope = scope.newscope(
:type => @type,
:name => objname,
- :keyword => self.keyword,
- :autoname => self.autoname
+ :keyword => self.keyword
)
if hash[:newcontext]
#scope.warning "Setting context to %s" % self.object_id
@@ -40,11 +39,6 @@ class Puppet::Parser::AST
#scope.keyword = self.keyword
- # Retain the fact that we were autonamed, if so
- if self.autoname
- scope.autoname = true
- end
-
#if self.is_a?(Node)
# scope.isnodescope
#end
diff --git a/lib/puppet/parser/ast/objectdef.rb b/lib/puppet/parser/ast/objectdef.rb
index 4ed48d3a4..abd709a84 100644
--- a/lib/puppet/parser/ast/objectdef.rb
+++ b/lib/puppet/parser/ast/objectdef.rb
@@ -15,21 +15,6 @@ class Puppet::Parser::AST
return @params[index]
end
- # Auto-generate a name
- def autoname(type, object)
- case object
- when Puppet::Type:
- raise Puppet::Error,
- "Built-in types must be provided with a name"
- when Node:
- return type
- else
- Puppet.debug "Autogenerating name for object of type %s" %
- type
- return [type, "-", self.object_id].join("")
- end
- end
-
# Iterate across all of our children.
def each
[@type,@name,@params].flatten.each { |param|
@@ -70,7 +55,6 @@ class Puppet::Parser::AST
raise error
end
- autonamed = false
objnames = [nil]
# Autogenerate the name if one was not passed.
if self.name
@@ -79,10 +63,6 @@ class Puppet::Parser::AST
unless objnames.is_a?(Array)
objnames = [objnames]
end
- #else
- # objnames = self.autoname(objtype, object)
- # autonamed = true
-
end
# Retrieve the defaults for our type
@@ -144,9 +124,6 @@ class Puppet::Parser::AST
:name => objname
)
- # Retain any name generation stuff
- obj.autoname = autonamed
-
# and pass the result on
obj
end
diff --git a/lib/puppet/parser/scope.rb b/lib/puppet/parser/scope.rb
index b1b2b6b81..344372327 100644
--- a/lib/puppet/parser/scope.rb
+++ b/lib/puppet/parser/scope.rb
@@ -10,7 +10,7 @@ module Puppet
include Enumerable
attr_accessor :parent, :level, :interp
- attr_accessor :name, :type, :topscope, :base, :keyword, :autoname
+ attr_accessor :name, :type, :topscope, :base, :keyword
attr_accessor :top, :context
@@ -843,7 +843,6 @@ module Puppet
if defined? @name and @name
bucket.name = @name
- bucket.autoname = self.autoname
end
# it'd be nice not to have to do this...