summaryrefslogtreecommitdiffstats
path: root/lib/puppet/element.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/puppet/element.rb')
-rw-r--r--lib/puppet/element.rb21
1 files changed, 6 insertions, 15 deletions
diff --git a/lib/puppet/element.rb b/lib/puppet/element.rb
index 3991160db..4d1ad8bac 100644
--- a/lib/puppet/element.rb
+++ b/lib/puppet/element.rb
@@ -25,19 +25,7 @@ class Puppet::Element
}
}
- # create instance methods for each of the log levels, too
- Puppet::Log.eachlevel { |level|
- define_method(level,proc { |args|
- if args.is_a?(Array)
- args = args.join(" ")
- end
- Puppet::Log.create(
- :level => level,
- :source => self,
- :message => args
- )
- })
- }
+ Puppet::Util.logmethods(self, true)
# for testing whether we should actually do anything
def noop
@@ -66,8 +54,11 @@ class Puppet::Element
else
# We assume that if we don't have a parent that we should not
# cache the path
- Puppet.warning "%s has no parent" % self.name
- @path = [self.class.name.to_s + "=" + self.name]
+ if self.is_a?(Puppet::Type::Component)
+ @path = [self.name]
+ else
+ @path = [self.class.name.to_s + "=" + self.name]
+ end
end
end
end