summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPeter Meier <peter.meier@immerda.ch>2009-02-22 00:11:34 +0100
committerJames Turnbull <james@lovedthanlost.net>2009-02-22 23:59:41 +1100
commitf07d9283d70378066987017d436db6deb1adae9d (patch)
treee33cbe6ebd7bfa1d90ec798ea6b62c138faf3cc2
parent25a3f59be4a514629db6825ce4b5abb99371ae3e (diff)
downloadpuppet-f07d9283d70378066987017d436db6deb1adae9d.tar.gz
puppet-f07d9283d70378066987017d436db6deb1adae9d.tar.xz
puppet-f07d9283d70378066987017d436db6deb1adae9d.zip
Use Puppet.debug instead of own debug flag
It's better to use puppet's logging environment than an own. Especially if the default is quite verbose and can't be set by config flag.
-rw-r--r--lib/puppet/rails/host.rb12
1 files changed, 5 insertions, 7 deletions
diff --git a/lib/puppet/rails/host.rb b/lib/puppet/rails/host.rb
index a429cbfb1..b60b0689d 100644
--- a/lib/puppet/rails/host.rb
+++ b/lib/puppet/rails/host.rb
@@ -3,8 +3,6 @@ require 'puppet/rails/fact_name'
require 'puppet/rails/source_file'
require 'puppet/util/rails/collection_merger'
-Puppet::TIME_DEBUG = true
-
class Puppet::Rails::Host < ActiveRecord::Base
include Puppet::Util
include Puppet::Util::CollectionMerger
@@ -36,7 +34,7 @@ class Puppet::Rails::Host < ActiveRecord::Base
host = new(:name => node.name)
end
}
- Puppet.notice("Searched for host in %0.2f seconds" % seconds) if defined?(Puppet::TIME_DEBUG)
+ Puppet.debug("Searched for host in %0.2f seconds" % seconds)
if ip = node.parameters["ipaddress"]
host.ip = ip
end
@@ -51,7 +49,7 @@ class Puppet::Rails::Host < ActiveRecord::Base
seconds = Benchmark.realtime {
host.setresources(resources)
}
- Puppet.notice("Handled resources in %0.2f seconds" % seconds) if defined?(Puppet::TIME_DEBUG)
+ Puppet.debug("Handled resources in %0.2f seconds" % seconds)
host.last_compile = Time.now
@@ -119,17 +117,17 @@ class Puppet::Rails::Host < ActiveRecord::Base
seconds = Benchmark.realtime {
existing = find_resources()
}
- Puppet.notice("Searched for resources in %0.2f seconds" % seconds) if defined?(Puppet::TIME_DEBUG)
+ Puppet.debug("Searched for resources in %0.2f seconds" % seconds)
seconds = Benchmark.realtime {
find_resources_parameters_tags(existing)
} if id
- Puppet.notice("Searched for resource params and tags in %0.2f seconds" % seconds) if defined?(Puppet::TIME_DEBUG)
+ Puppet.debug("Searched for resource params and tags in %0.2f seconds" % seconds)
seconds = Benchmark.realtime {
compare_to_catalog(existing, list)
}
- Puppet.notice("Resource comparison took %0.2f seconds" % seconds) if defined?(Puppet::TIME_DEBUG)
+ Puppet.debug("Resource comparison took %0.2f seconds" % seconds)
end
def find_resources