summaryrefslogtreecommitdiff
path: root/lib/puppet
diff options
context:
space:
mode:
authorJeff McCune <jeff@puppetlabs.com>2012-05-10 22:13:46 -0700
committerJeff McCune <jeff@puppetlabs.com>2012-05-10 22:13:46 -0700
commitfb43a6ff2fa2bc32c7fa9e1353e3b88a4dcdaa60 (patch)
tree54de34b7a0a97d011287730927b465ed8bd85a37 /lib/puppet
parentf84c02011f3c00149dead77d712770d9468ad706 (diff)
parent1373e70639e0105ec314c006bd82545573a389e6 (diff)
Merge branch 'fix/2.3.x/file_line_ensure' into 2.3.x
* fix/2.3.x/file_line_ensure: Make file_line default to ensure => present Memoize file_line spec instance variables Fix spec tests using the new spec_helper
Diffstat (limited to 'lib/puppet')
-rw-r--r--lib/puppet/type/file_line.rb10
1 files changed, 6 insertions, 4 deletions
diff --git a/lib/puppet/type/file_line.rb b/lib/puppet/type/file_line.rb
index 9f03771..8559cfa 100644
--- a/lib/puppet/type/file_line.rb
+++ b/lib/puppet/type/file_line.rb
@@ -23,18 +23,20 @@ Puppet::Type.newtype(:file_line) do
EOT
- ensurable
+ ensurable do
+ defaultto :present
+ end
newparam(:name, :namevar => true) do
- desc 'arbitrary name used as identity'
+ desc 'An arbitrary name used as the identity of the resource.'
end
newparam(:line) do
- desc 'The line to be appended to the path.'
+ desc 'The line to be appended to the file located by the path parameter.'
end
newparam(:path) do
- desc 'File to possibly append a line to.'
+ desc 'The file Puppet will ensure contains the line specified by the line parameter.'
validate do |value|
unless (Puppet.features.posix? and value =~ /^\//) or (Puppet.features.microsoft_windows? and (value =~ /^.:\// or value =~ /^\/\/[^\/]+\/[^\/]+/))
raise(Puppet::Error, "File paths must be fully qualified, not '#{value}'")