[Pkg-puppet-devel] [SCM] Puppet packaging for Debian branch, upstream, updated. puppet-0.24.5-rc3-1601-gf8c1b08

James Turnbull james at lovedthanlost.net
Fri Jan 15 09:08:05 UTC 2010


The following commit has been merged in the upstream branch:
commit b86decc0ea274eb6d9ffa3170fd4ec81d735519f
Author: Jesse Wolfe <jes5199 at gmail.com>
Date:   Thu Dec 17 14:47:19 2009 -0800

    Fix #2816 MySQL server has gone away
    
    As suggested in the ticket, set :reconnect to true. Our in-house Rails
    experts suggest that this is unlikely to cause any problems.
    The setting is silently ignored before Rails 2.3

diff --git a/lib/puppet/rails.rb b/lib/puppet/rails.rb
index 98d8297..98c0e3d 100644
--- a/lib/puppet/rails.rb
+++ b/lib/puppet/rails.rb
@@ -54,6 +54,7 @@ module Puppet::Rails
             args[:username] = Puppet[:dbuser] unless Puppet[:dbuser].empty?
             args[:password] = Puppet[:dbpassword] unless Puppet[:dbpassword].empty?
             args[:database] = Puppet[:dbname]
+            args[:reconnect]= true
 
             socket          = Puppet[:dbsocket]
             args[:socket]   = socket unless socket.empty?
diff --git a/spec/unit/rails.rb b/spec/unit/rails.rb
index 0302873..f61288f 100755
--- a/spec/unit/rails.rb
+++ b/spec/unit/rails.rb
@@ -90,7 +90,7 @@ end
 describe Puppet::Rails, "when initializing a mysql or postgresql connection" do
     confine "Cannot test without ActiveRecord" => Puppet.features.rails?
 
-    it "should provide the adapter, log_level, and host, username, password, and database arguments" do
+    it "should provide the adapter, log_level, and host, username, password, database, and reconnect arguments" do
         Puppet.settings.stubs(:value).with(:dbadapter).returns("mysql")
         Puppet.settings.stubs(:value).with(:rails_loglevel).returns("testlevel")
         Puppet.settings.stubs(:value).with(:dbserver).returns("testserver")
@@ -105,11 +105,12 @@ describe Puppet::Rails, "when initializing a mysql or postgresql connection" do
             :host => "testserver",
             :username => "testuser",
             :password => "testpassword",
-            :database => "testname"
+            :database => "testname",
+            :reconnect => true
         }
     end
 
-    it "should provide the adapter, log_level, and host, username, password, database, and socket arguments" do
+    it "should provide the adapter, log_level, and host, username, password, database, socket, and reconnect arguments" do
         Puppet.settings.stubs(:value).with(:dbadapter).returns("mysql")
         Puppet.settings.stubs(:value).with(:rails_loglevel).returns("testlevel")
         Puppet.settings.stubs(:value).with(:dbserver).returns("testserver")
@@ -125,7 +126,8 @@ describe Puppet::Rails, "when initializing a mysql or postgresql connection" do
             :username => "testuser",
             :password => "testpassword",
             :database => "testname",
-            :socket => "testsocket"
+            :socket => "testsocket",
+            :reconnect => true
         }
     end
 end

-- 
Puppet packaging for Debian



More information about the Pkg-puppet-devel mailing list