diff options
| author | Luke Kanies <luke@madstop.com> | 2009-06-16 11:03:46 -0500 |
|---|---|---|
| committer | James Turnbull <james@lovedthanlost.net> | 2009-06-19 03:54:08 +1000 |
| commit | 3f070c118b1ae2f3c76172d320ff04e92618a9b3 (patch) | |
| tree | d83ac71f1de8c6ee63bb8a00116c8a6e9200011b /lib/puppet/module.rb | |
| parent | feb7f89078f038e20895ff2c8042326e6b85b957 (diff) | |
| download | puppet-3f070c118b1ae2f3c76172d320ff04e92618a9b3.tar.gz puppet-3f070c118b1ae2f3c76172d320ff04e92618a9b3.tar.xz puppet-3f070c118b1ae2f3c76172d320ff04e92618a9b3.zip | |
Using the logging utilities to clean up module warnings
This just makes it easier to add context to warnings
and other logs from the module.
Signed-off-by: Luke Kanies <luke@madstop.com>
Diffstat (limited to 'lib/puppet/module.rb')
| -rw-r--r-- | lib/puppet/module.rb | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/lib/puppet/module.rb b/lib/puppet/module.rb index 38ff2bf55..3a6f04d15 100644 --- a/lib/puppet/module.rb +++ b/lib/puppet/module.rb @@ -1,5 +1,8 @@ +require 'puppet/util/logging' + # Support for modules class Puppet::Module + include Puppet::Util::Logging TEMPLATES = "templates" FILES = "files" @@ -118,6 +121,14 @@ class Puppet::Module subpath("plugins") end + def to_s + result = "Module %s" % name + if path + result += "(%s)" % path + end + result + end + private def find_init_manifest @@ -133,7 +144,7 @@ class Puppet::Module def backward_compatible_plugins_dir if dir = File.join(path, "plugins") and FileTest.exist?(dir) - Puppet.warning "Module %s uses the deprecated 'plugins' directory for ruby extensions; please move to 'lib'" % name + warning "using the deprecated 'plugins' directory for ruby extensions; please move to 'lib'" return dir else return File.join(path, "lib") |
