diff options
author | luke <luke@980ebf18-57e1-0310-9a29-db15c13687c0> | 2006-02-27 22:25:59 +0000 |
---|---|---|
committer | luke <luke@980ebf18-57e1-0310-9a29-db15c13687c0> | 2006-02-27 22:25:59 +0000 |
commit | 020499c70a69786e24b0136427b87c8967d40690 (patch) | |
tree | e4f312d95921d3682f27a0e3be1a663de238d748 /lib | |
parent | 8c821c09eebe117bd8b100b6dc416ded0588b979 (diff) | |
download | puppet-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')
-rw-r--r-- | lib/puppet/config.rb | 2 | ||||
-rw-r--r-- | lib/puppet/parser/ast/component.rb | 10 | ||||
-rw-r--r-- | lib/puppet/parser/ast/objectdef.rb | 23 | ||||
-rw-r--r-- | lib/puppet/parser/scope.rb | 3 | ||||
-rw-r--r-- | lib/puppet/transportable.rb | 3 |
5 files changed, 4 insertions, 37 deletions
diff --git a/lib/puppet/config.rb b/lib/puppet/config.rb index 010473dbf..b8a41ca4d 100644 --- a/lib/puppet/config.rb +++ b/lib/puppet/config.rb @@ -321,7 +321,6 @@ class Config } bucket = Puppet::TransBucket.new - bucket.autoname = true bucket.name = "autosection-%s" % bucket.object_id bucket.type = section bucket.push(*objects) @@ -399,7 +398,6 @@ Generated on #{Time.now}. end topbucket.type = "puppetconfig" topbucket.top = true - topbucket.autoname = true # Now iterate over each section eachsection do |section| 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... diff --git a/lib/puppet/transportable.rb b/lib/puppet/transportable.rb index 7b2fae768..0e3c3bb3a 100644 --- a/lib/puppet/transportable.rb +++ b/lib/puppet/transportable.rb @@ -91,7 +91,7 @@ module Puppet class TransBucket include Enumerable - attr_accessor :name, :type, :file, :line, :classes, :autoname, :keyword, :top + attr_accessor :name, :type, :file, :line, :classes, :keyword, :top %w{delete shift include? length empty? << []}.each { |method| define_method(method) do |*args| @@ -170,7 +170,6 @@ module Puppet name = nil # Nodes have the same name and type - #if self.autoname or @name == @type if self.name name = "%s[%s]" % [@type, self.name] else |