summaryrefslogtreecommitdiffstats
path: root/lib/puppet/provider
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/provider
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/provider')
-rwxr-xr-xlib/puppet/provider/mailalias/aliases.rb5
-rw-r--r--lib/puppet/provider/zone/solaris.rb3
2 files changed, 6 insertions, 2 deletions
diff --git a/lib/puppet/provider/mailalias/aliases.rb b/lib/puppet/provider/mailalias/aliases.rb
index 85dec29cc..8b5c45617 100755
--- a/lib/puppet/provider/mailalias/aliases.rb
+++ b/lib/puppet/provider/mailalias/aliases.rb
@@ -10,7 +10,10 @@ Puppet::Type.type(:mailalias).provide(:aliases,
record_line :aliases, :fields => %w{name recipient}, :separator => /\s*:\s*/, :block_eval => :instance do
def post_parse(record)
- record[:recipient] = record[:recipient].split(/\s*,\s*/).collect { |d| d.gsub(/^['"]|['"]$/, '') }
+ # LAK:NOTE See http://snurl.com/21zf8 [groups_google_com]
+ # It's not sufficient to assign to an existing hash.
+ recipient = record[:recipient].split(/\s*,\s*/).collect { |d| d.gsub(/^['"]|['"]$/, '') }
+ record[:recipient] = recipient
record
end
diff --git a/lib/puppet/provider/zone/solaris.rb b/lib/puppet/provider/zone/solaris.rb
index dd8698b92..be2dd97f9 100644
--- a/lib/puppet/provider/zone/solaris.rb
+++ b/lib/puppet/provider/zone/solaris.rb
@@ -26,7 +26,8 @@ Puppet::Type.type(:zone).provide(:solaris) do
end
def self.instances
- adm(:list, "-cp").split("\n").collect do |line|
+ # LAK:NOTE See http://snurl.com/21zf8 [groups_google_com]
+ x = adm(:list, "-cp").split("\n").collect do |line|
new(line2hash(line))
end
end