summaryrefslogtreecommitdiffstats
path: root/lib/puppet/util
diff options
context:
space:
mode:
authorJacob Helwig <jacob@puppetlabs.com>2011-02-03 19:14:23 -0800
committerJacob Helwig <jacob@puppetlabs.com>2011-02-03 19:14:23 -0800
commitec4254dec20c8cc8ab9ef3065f4325ed52b9eacd (patch)
tree1d847e457af83163dadd933632ab3af1eeedbddd /lib/puppet/util
parent876d0503dd93329a73e7f335c10a47330d745293 (diff)
parente10ba1ab720cb62b39b430104a55a987f4c37f31 (diff)
downloadpuppet-ec4254dec20c8cc8ab9ef3065f4325ed52b9eacd.tar.gz
puppet-ec4254dec20c8cc8ab9ef3065f4325ed52b9eacd.tar.xz
puppet-ec4254dec20c8cc8ab9ef3065f4325ed52b9eacd.zip
Merge branch '2.6.next' into 2.6.x
* 2.6.next: (#6018) Nick F's --help text for puppet inspect. (#5823) document the not-an-API status of set_run_mode (#5823) run mode can now be set dynamically... (6114) Update the audit metaparameter for 2.6.5. Fix for #5755 -- making zaml serialization robust over projected objects (#4139) hook log autoflush into global defaults
Diffstat (limited to 'lib/puppet/util')
-rw-r--r--lib/puppet/util/log.rb6
-rw-r--r--lib/puppet/util/log/destinations.rb2
-rw-r--r--lib/puppet/util/zaml.rb2
3 files changed, 10 insertions, 0 deletions
diff --git a/lib/puppet/util/log.rb b/lib/puppet/util/log.rb
index 3fdac3f69..ba1690078 100644
--- a/lib/puppet/util/log.rb
+++ b/lib/puppet/util/log.rb
@@ -67,6 +67,12 @@ class Puppet::Util::Log
}
end
+ def Log.autoflush=(v)
+ @destinations.each do |type, dest|
+ dest.autoflush = v if dest.respond_to?(:autoflush=)
+ end
+ end
+
# Create a new log message. The primary role of this method is to
# avoid creating log messages below the loglevel.
def Log.create(hash)
diff --git a/lib/puppet/util/log/destinations.rb b/lib/puppet/util/log/destinations.rb
index 22b3dedb2..c70edeb02 100644
--- a/lib/puppet/util/log/destinations.rb
+++ b/lib/puppet/util/log/destinations.rb
@@ -50,6 +50,8 @@ Puppet::Util::Log.newdesttype :file do
@file.flush if defined?(@file)
end
+ attr_accessor :autoflush
+
def initialize(path)
@name = path
# first make sure the directory exists
diff --git a/lib/puppet/util/zaml.rb b/lib/puppet/util/zaml.rb
index 14aa90e5f..b22dfc199 100644
--- a/lib/puppet/util/zaml.rb
+++ b/lib/puppet/util/zaml.rb
@@ -20,6 +20,7 @@ class ZAML
def self.dump(stuff, where='')
z = new
stuff.to_zaml(z)
+ Label.counter_reset
where << z.to_s
end
#
@@ -61,6 +62,7 @@ class ZAML
end
def initialize(obj)
@this_label_number = nil
+ @obj = obj # prevent garbage collection so that object id isn't reused
@@previously_emitted_object[obj.object_id] = self
end
def to_s