From dfcee63afb19d72677f177e83ce237765cccf0f7 Mon Sep 17 00:00:00 2001 From: Peter Meier Date: Wed, 23 May 2012 21:42:07 +0200 Subject: (#14670) autorequire a file_line resource's path If we manage a file we edit with file_line, it should be autorequired by file_line. Without this patch applied the relationship is not automatically setup and the user is forced to manually manage the relationship. --- lib/puppet/type/file_line.rb | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'lib') diff --git a/lib/puppet/type/file_line.rb b/lib/puppet/type/file_line.rb index 6b35902..f71a4bc 100644 --- a/lib/puppet/type/file_line.rb +++ b/lib/puppet/type/file_line.rb @@ -50,6 +50,11 @@ Puppet::Type.newtype(:file_line) do end end + # Autorequire the file resource if it's being managed + autorequire(:file) do + self[:path] + end + validate do unless self[:line] and self[:path] raise(Puppet::Error, "Both line and path are required attributes") -- cgit v1.2.3