summaryrefslogtreecommitdiffstats
path: root/lib/puppet/network
diff options
context:
space:
mode:
authorLuke Kanies <luke@madstop.com>2008-03-21 00:39:26 -0500
committerLuke Kanies <luke@madstop.com>2008-03-21 00:39:26 -0500
commit18320b8e3271f7d1d1702907be1ff420acfc8d2b (patch)
tree159cde5158579fc3b0ae6e502c25b32752d7561c /lib/puppet/network
parentf6325dceb3b10c300f421f540281bbd64bdc091e (diff)
downloadpuppet-18320b8e3271f7d1d1702907be1ff420acfc8d2b.tar.gz
puppet-18320b8e3271f7d1d1702907be1ff420acfc8d2b.tar.xz
puppet-18320b8e3271f7d1d1702907be1ff420acfc8d2b.zip
Found all instances of methods where split() is used without
any local variables and added a local variable -- see http://snurl.com/21zf8. My own testing showed that this caused memory growth to level off at a reasonable level. Note that the link above says the problem is only with class methods, but my own testing showed that it's any method that meets these criteria. This is not a functional change, but should hopefully be the last nail in the coffin of #1131.
Diffstat (limited to 'lib/puppet/network')
-rwxr-xr-xlib/puppet/network/authstore.rb3
-rw-r--r--lib/puppet/network/client/master.rb6
-rwxr-xr-xlib/puppet/network/handler/report.rb3
-rw-r--r--lib/puppet/network/http/mongrel/rest.rb6
-rw-r--r--lib/puppet/network/http/webrick/rest.rb8
5 files changed, 17 insertions, 9 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/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/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