summaryrefslogtreecommitdiffstats
path: root/lib/puppet
diff options
context:
space:
mode:
authorJesse Wolfe <jes5199@gmail.com>2011-03-25 16:24:01 -0700
committerJesse Wolfe <jes5199@gmail.com>2011-03-25 16:24:01 -0700
commitcc43dd79ad8d40b5b7bf3f4480ff794e99f733a4 (patch)
tree22a21fb53c44bcb433dafb8bb373e3f41afde6eb /lib/puppet
parentc0236aab1145e01e26f59cf1d823dc6966ba567b (diff)
parent0fec21fcd887685cf8421fdc309b878088f9fc48 (diff)
downloadpuppet-cc43dd79ad8d40b5b7bf3f4480ff794e99f733a4.tar.gz
puppet-cc43dd79ad8d40b5b7bf3f4480ff794e99f733a4.tar.xz
puppet-cc43dd79ad8d40b5b7bf3f4480ff794e99f733a4.zip
Merge commit '2.6.next^1' into next
These changes were superseded by existing commits in next: lib/puppet/parser/compiler.rb spec/unit/parser/compiler_spec.rb
Diffstat (limited to 'lib/puppet')
-rw-r--r--lib/puppet/file_serving/fileset.rb1
-rwxr-xr-xlib/puppet/type/exec.rb14
2 files changed, 7 insertions, 8 deletions
diff --git a/lib/puppet/file_serving/fileset.rb b/lib/puppet/file_serving/fileset.rb
index fdbcf93a3..c020f036d 100644
--- a/lib/puppet/file_serving/fileset.rb
+++ b/lib/puppet/file_serving/fileset.rb
@@ -59,6 +59,7 @@ class Puppet::FileServing::Fileset
end
def initialize(path, options = {})
+ path = path.chomp(File::SEPARATOR)
raise ArgumentError.new("Fileset paths must be fully qualified") unless File.expand_path(path) == path
@path = path
diff --git a/lib/puppet/type/exec.rb b/lib/puppet/type/exec.rb
index 773df2bb4..3ba488f19 100755
--- a/lib/puppet/type/exec.rb
+++ b/lib/puppet/type/exec.rb
@@ -220,19 +220,17 @@ module Puppet
newparam(:timeout) do
desc "The maximum time the command should take. If the command takes
longer than the timeout, the command is considered to have failed
- and will be stopped. Use any negative number to disable the timeout.
+ and will be stopped. Use 0 to disable the timeout.
The time is specified in seconds."
munge do |value|
value = value.shift if value.is_a?(Array)
- if value.is_a?(String)
- unless value =~ /^[-\d.]+$/
- raise ArgumentError, "The timeout must be a number."
- end
- Float(value)
- else
- value
+ begin
+ value = Float(value)
+ rescue ArgumentError => e
+ raise ArgumentError, "The timeout must be a number."
end
+ [value, 0.0].max
end
defaultto 300