diff options
Diffstat (limited to 'lib/puppet/network')
-rwxr-xr-x | lib/puppet/network/authstore.rb | 3 | ||||
-rw-r--r-- | lib/puppet/network/client.rb | 5 | ||||
-rw-r--r-- | lib/puppet/network/client/master.rb | 6 | ||||
-rw-r--r-- | lib/puppet/network/handler/master.rb | 2 | ||||
-rwxr-xr-x | lib/puppet/network/handler/report.rb | 3 | ||||
-rw-r--r-- | lib/puppet/network/http/mongrel/rest.rb | 6 | ||||
-rw-r--r-- | lib/puppet/network/http/webrick/rest.rb | 8 | ||||
-rw-r--r-- | lib/puppet/network/http_pool.rb | 25 |
8 files changed, 39 insertions, 19 deletions
diff --git a/lib/puppet/network/authstore.rb b/lib/puppet/network/authstore.rb index c16bef32f..cb1fdc57d 100755 --- a/lib/puppet/network/authstore.rb +++ b/lib/puppet/network/authstore.rb @@ -235,7 +235,8 @@ module Puppet # Convert the name to a common pattern. def munge_name(name) - name.downcase.split(".").reverse + # LAK:NOTE http://snurl.com/21zf8 [groups_google_com] + x = name.downcase.split(".").reverse end # Parse our input pattern and figure out what kind of allowal diff --git a/lib/puppet/network/client.rb b/lib/puppet/network/client.rb index cf1782f79..478883959 100644 --- a/lib/puppet/network/client.rb +++ b/lib/puppet/network/client.rb @@ -96,8 +96,9 @@ class Puppet::Network::Client self.read_cert # We have to start the HTTP connection manually before we start - # sending it requests or keep-alive won't work. - @driver.start if @driver.respond_to? :start + # sending it requests or keep-alive won't work. Note that with #1010, + # we don't currently actually want keep-alive. + @driver.start if @driver.respond_to? :start and Puppet::Network::HttpPool.keep_alive? @local = false elsif hash.include?(driverparam) diff --git a/lib/puppet/network/client/master.rb b/lib/puppet/network/client/master.rb index e914d5c69..955acbfb5 100644 --- a/lib/puppet/network/client/master.rb +++ b/lib/puppet/network/client/master.rb @@ -50,7 +50,8 @@ class Puppet::Network::Client::Master < Puppet::Network::Client # Return the list of dynamic facts as an array of symbols def self.dynamic_facts - Puppet.settings[:dynamicfacts].split(/\s*,\s*/).collect { |fact| fact.downcase } + # LAK:NOTE See http://snurl.com/21zf8 [groups_google_com] + x = Puppet.settings[:dynamicfacts].split(/\s*,\s*/).collect { |fact| fact.downcase } end # Cache the config @@ -425,7 +426,8 @@ class Puppet::Network::Client::Master < Puppet::Network::Client end def self.loadfacts - Puppet[:factpath].split(":").each do |dir| + # LAK:NOTE See http://snurl.com/21zf8 [groups_google_com] + x = Puppet[:factpath].split(":").each do |dir| loaddir(dir, "fact") end end diff --git a/lib/puppet/network/handler/master.rb b/lib/puppet/network/handler/master.rb index 3e004046e..dabfaca50 100644 --- a/lib/puppet/network/handler/master.rb +++ b/lib/puppet/network/handler/master.rb @@ -81,9 +81,9 @@ class Puppet::Network::Handler clientip = facts["ipaddress"] if Puppet[:node_name] == 'cert' if name + client = name facts["fqdn"] = client facts["hostname"], facts["domain"] = client.split('.', 2) - client = name end if ip clientip = ip diff --git a/lib/puppet/network/handler/report.rb b/lib/puppet/network/handler/report.rb index 8ddeed9f6..b92b77ea5 100755 --- a/lib/puppet/network/handler/report.rb +++ b/lib/puppet/network/handler/report.rb @@ -79,7 +79,8 @@ class Puppet::Network::Handler # Handle the parsing of the reports attribute. def reports - Puppet[:reports].gsub(/(^\s+)|(\s+$)/, '').split(/\s*,\s*/) + # LAK:NOTE See http://snurl.com/21zf8 [groups_google_com] + x = Puppet[:reports].gsub(/(^\s+)|(\s+$)/, '').split(/\s*,\s*/) end end end diff --git a/lib/puppet/network/http/mongrel/rest.rb b/lib/puppet/network/http/mongrel/rest.rb index db63613ab..6c24e360c 100644 --- a/lib/puppet/network/http/mongrel/rest.rb +++ b/lib/puppet/network/http/mongrel/rest.rb @@ -14,11 +14,13 @@ class Puppet::Network::HTTP::MongrelREST < Puppet::Network::HTTP::Handler end def path(request) - '/' + request.params[Mongrel::Const::REQUEST_PATH].split('/')[1] + # LAK:NOTE See http://snurl.com/21zf8 [groups_google_com] + x = '/' + request.params[Mongrel::Const::REQUEST_PATH].split('/')[1] end def request_key(request) - request.params[Mongrel::Const::REQUEST_PATH].split('/')[2] + # LAK:NOTE See http://snurl.com/21zf8 [groups_google_com] + x = request.params[Mongrel::Const::REQUEST_PATH].split('/')[2] end def body(request) diff --git a/lib/puppet/network/http/webrick/rest.rb b/lib/puppet/network/http/webrick/rest.rb index dd0c84d61..8cda079e2 100644 --- a/lib/puppet/network/http/webrick/rest.rb +++ b/lib/puppet/network/http/webrick/rest.rb @@ -19,11 +19,13 @@ class Puppet::Network::HTTP::WEBrickREST < Puppet::Network::HTTP::Handler end def path(request) - '/' + request.path.split('/')[1] + # LAK:NOTE See http://snurl.com/21zf8 [groups_google_com] + x = '/' + request.path.split('/')[1] end def request_key(request) - request.path.split('/')[2] + # LAK:NOTE See http://snurl.com/21zf8 [groups_google_com] + x = request.path.split('/')[2] end def body(request) @@ -38,4 +40,4 @@ class Puppet::Network::HTTP::WEBrickREST < Puppet::Network::HTTP::Handler response.status = status response.body = result end -end
\ No newline at end of file +end diff --git a/lib/puppet/network/http_pool.rb b/lib/puppet/network/http_pool.rb index 69574d8fd..9d37f2eeb 100644 --- a/lib/puppet/network/http_pool.rb +++ b/lib/puppet/network/http_pool.rb @@ -6,6 +6,15 @@ end # Manage Net::HTTP instances for keep-alive. module Puppet::Network::HttpPool + # 2008/03/23 + # LAK:WARNING: Enabling this has a high propability of + # causing corrupt files and who knows what else. See #1010. + HTTP_KEEP_ALIVE = false + + def self.keep_alive? + HTTP_KEEP_ALIVE + end + # This handles reading in the key and such-like. extend Puppet::SSLCertificates::Support @http_cache = {} @@ -56,12 +65,14 @@ module Puppet::Network::HttpPool # Return our cached instance if we've got a cache, as long as we're not # resetting the instance. - return @http_cache[key] if ! reset and @http_cache[key] - - # Clean up old connections if we have them. - if http = @http_cache[key] - @http_cache.delete(key) - http.finish if http.started? + if keep_alive? + return @http_cache[key] if ! reset and @http_cache[key] + + # Clean up old connections if we have them. + if http = @http_cache[key] + @http_cache.delete(key) + http.finish if http.started? + end end args = [host, port] @@ -88,7 +99,7 @@ module Puppet::Network::HttpPool cert_setup(http) - @http_cache[key] = http + @http_cache[key] = http if keep_alive? return http end |