]> git.donarmstrong.com Git - dsa-puppet.git/commitdiff
I suspect that while the inline read was shorter, it was leaking fds
authorStephen Gran <steve@lobefin.net>
Wed, 22 Apr 2009 23:52:36 +0000 (00:52 +0100)
committerStephen Gran <steve@lobefin.net>
Wed, 22 Apr 2009 23:52:36 +0000 (00:52 +0100)
Signed-off-by: Stephen Gran <steve@lobefin.net>
templates/motd.erb

index 1881c41b37ec7b4378eb2ed5be147e75a21838c0..a0a7a72554956526c4366a3aed6f0a7b3a7e2625 100644 (file)
@@ -3,6 +3,8 @@ is monitored and will be used as evidence for prosecutions.
 
 <% if File.exists?("/etc/puppet/modules/motd/files/" + fqdn + "/motd.tail") -%>
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-<%= File.open("/etc/puppet/modules/motd/files/" + fqdn + "/motd.tail").read -%>
+<% f = File.open("/etc/puppet/modules/motd/files/" + fqdn + "/motd.tail") -%>
+<%= f.read -%>
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+<% f.close -%>
 <% end -%>