diff options
author | Luke Kanies <luke@madstop.com> | 2005-07-12 13:32:31 +0000 |
---|---|---|
committer | Luke Kanies <luke@madstop.com> | 2005-07-12 13:32:31 +0000 |
commit | 78bcfdc1e21e7ad4d89b990fd0cf6d87db563d51 (patch) | |
tree | 005a4ca455ebd1ece8ef4a7358fd7ad172c360c6 /lib/puppet | |
parent | 99a9f4b0c16b42ea16e1df9e38714697215fc308 (diff) | |
download | puppet-78bcfdc1e21e7ad4d89b990fd0cf6d87db563d51.tar.gz puppet-78bcfdc1e21e7ad4d89b990fd0cf6d87db563d51.tar.xz puppet-78bcfdc1e21e7ad4d89b990fd0cf6d87db563d51.zip |
adding path stuff everywhere, although i had to keep component names kind of funky
git-svn-id: https://reductivelabs.com/svn/puppet/library/trunk@378 980ebf18-57e1-0310-9a29-db15c13687c0
Diffstat (limited to 'lib/puppet')
-rw-r--r-- | lib/puppet/type.rb | 6 | ||||
-rw-r--r-- | lib/puppet/type/component.rb | 17 | ||||
-rw-r--r-- | lib/puppet/type/pfile.rb | 3 |
3 files changed, 19 insertions, 7 deletions
diff --git a/lib/puppet/type.rb b/lib/puppet/type.rb index 5072a0860..79402c94e 100644 --- a/lib/puppet/type.rb +++ b/lib/puppet/type.rb @@ -615,7 +615,11 @@ class Type < Puppet::Element # return the full path to us, for logging and rollback # some classes (e.g., FileTypeRecords) will have to override this def path - return [self.class, self.name].flatten + if defined? @parent + return [@parent.name, self.name].flatten + else + return [self.name] + end end #--------------------------------------------------------------- diff --git a/lib/puppet/type/component.rb b/lib/puppet/type/component.rb index c3ba3fadf..bb7b57433 100644 --- a/lib/puppet/type/component.rb +++ b/lib/puppet/type/component.rb @@ -38,8 +38,13 @@ Component def initialize(args) @children = [] + + # it makes sense to have a more reasonable default here than 'false' + unless args.include?(:type) or args.include?("type") + args[:type] = "component" + end super(args) - debug "Made component with name %s" % self.name + debug "Made component with name %s and type %s" % [self.name, self[:type]] end # just turn the container into a transaction @@ -49,6 +54,11 @@ Component return transaction end + def name + return self[:name] + #return "%s[%s]" % [self[:type],self[:name]] + end + def push(*ary) ary.each { |child| unless child.is_a?(Puppet::Element) @@ -56,13 +66,10 @@ Component raise "Containers can only contain Puppet::Elements" end @children.push child + child.parent = self } end - def name - return "%s[%s]" % [@parameters[:type],@parameters[:name]] - end - def refresh @children.collect { |child| if child.respond_to?(:refresh) diff --git a/lib/puppet/type/pfile.rb b/lib/puppet/type/pfile.rb index e8f50e74b..1db63f8fd 100644 --- a/lib/puppet/type/pfile.rb +++ b/lib/puppet/type/pfile.rb @@ -213,7 +213,8 @@ module Puppet # unless we're fully qualified or we've specifically allowed # relative links. Relative links are currently disabled, until # someone actually asks for them - unless @should =~ /^\// or self.parent[:relativelinks] + #unless @should =~ /^\// or self.parent[:relativelinks] + unless @should =~ /^\// @should = File.expand_path @should end end |