summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorluke <luke@980ebf18-57e1-0310-9a29-db15c13687c0>2006-08-28 05:32:04 +0000
committerluke <luke@980ebf18-57e1-0310-9a29-db15c13687c0>2006-08-28 05:32:04 +0000
commit9f7621b04acd7ed4845afd1182e1e6ce13e8fb04 (patch)
tree7265747f5f70910574c6ccf04cf86c00c6da5ac0 /lib
parentad32b716d82576c98e708e6dbbcec60f0372e54c (diff)
downloadpuppet-9f7621b04acd7ed4845afd1182e1e6ce13e8fb04.tar.gz
puppet-9f7621b04acd7ed4845afd1182e1e6ce13e8fb04.tar.xz
puppet-9f7621b04acd7ed4845afd1182e1e6ce13e8fb04.zip
Adding a little more validation to the schedule, and documenting the source search-path stuff in files
git-svn-id: https://reductivelabs.com/svn/puppet/trunk@1495 980ebf18-57e1-0310-9a29-db15c13687c0
Diffstat (limited to 'lib')
-rwxr-xr-xlib/puppet/type/pfile/source.rb13
-rwxr-xr-xlib/puppet/type/schedule.rb14
2 files changed, 26 insertions, 1 deletions
diff --git a/lib/puppet/type/pfile/source.rb b/lib/puppet/type/pfile/source.rb
index 2bdce9240..c0bfab310 100755
--- a/lib/puppet/type/pfile/source.rb
+++ b/lib/puppet/type/pfile/source.rb
@@ -25,6 +25,19 @@ module Puppet
See the [fileserver docs][] for information on how to configure
and use file services within Puppet.
+ If you specify multiple file sources for a file, then the first
+ source that exists will be used. This allows you to specify
+ what amount to search paths for files:
+
+ file { \"/path/to/my/file\":
+ source => [
+ \"/nfs/files/file.$host\",
+ \"/nfs/files/file.$operatingsystem\",
+ \"/nfs/files/file\"
+ ]
+ }
+
+ This will use the first found file as the source.
[fileserver docs]: fsconfigref.html
diff --git a/lib/puppet/type/schedule.rb b/lib/puppet/type/schedule.rb
index 0fd6a533a..8c89ab906 100755
--- a/lib/puppet/type/schedule.rb
+++ b/lib/puppet/type/schedule.rb
@@ -104,6 +104,18 @@ module Puppet
self.fail "Invalid range %s" % value
end
+ # Make sure the hours are valid
+ [range[0][0], range[1][0]].each do |n|
+ if n < 0 or n > 23
+ raise ArgumentError, "Invalid hour '%s'" % n
+ end
+ end
+
+ [range[0][1], range[1][1]].each do |n|
+ if n and (n < 0 or n > 59)
+ raise ArgumentError, "Invalid minute '%s'" % n
+ end
+ end
if range[0][0] > range[1][0]
self.fail(("Invalid range %s; " % value) +
"ranges cannot span days."
@@ -261,7 +273,7 @@ module Puppet
newparam(:repeat) do
desc "How often the application gets repeated in a given period.
- Defaults to 1."
+ Defaults to 1. Must be an integer."
defaultto 1