From ef9a4a6df163c370a524d9ab76453c96bb99e8a4 Mon Sep 17 00:00:00 2001 From: Brice Figureau Date: Sun, 25 Jul 2010 19:19:04 +0200 Subject: Fix #4245 - default insertion of ACL is not thread safe This can happen under jruby with native threads. Signed-off-by: Brice Figureau --- lib/puppet/network/rest_authconfig.rb | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'lib') diff --git a/lib/puppet/network/rest_authconfig.rb b/lib/puppet/network/rest_authconfig.rb index 38a8f9a09..82d5a9de2 100644 --- a/lib/puppet/network/rest_authconfig.rb +++ b/lib/puppet/network/rest_authconfig.rb @@ -3,6 +3,7 @@ require 'puppet/network/authconfig' module Puppet class Network::RestAuthConfig < Network::AuthConfig + extend MonitorMixin attr_accessor :rights DEFAULT_ACL = [ @@ -20,9 +21,11 @@ module Puppet ] def self.main - add_acl = @main.nil? - super - @main.insert_default_acl if add_acl and !@main.exists? + synchronize do + add_acl = @main.nil? + super + @main.insert_default_acl if add_acl and !@main.exists? + end @main end -- cgit