diff options
author | David Schmitt <david@dasz.at> | 2010-05-17 14:38:41 +0200 |
---|---|---|
committer | test branch <puppet-dev@googlegroups.com> | 2010-02-17 06:50:53 -0800 |
commit | 6a928940a43001f62cbd62d6c760c7d287bad855 (patch) | |
tree | 9aacb1f3dfd9d3f7c618463ae8c4bf06215bbb25 /lib/puppet | |
parent | 47c9dd16df3a31dddb486bc4d583ff3b86b0ac01 (diff) | |
download | puppet-6a928940a43001f62cbd62d6c760c7d287bad855.tar.gz puppet-6a928940a43001f62cbd62d6c760c7d287bad855.tar.xz puppet-6a928940a43001f62cbd62d6c760c7d287bad855.zip |
Avoid trying to symlink() on windows
Diffstat (limited to 'lib/puppet')
-rw-r--r-- | lib/puppet/type/file.rb | 4 | ||||
-rw-r--r-- | lib/puppet/type/file/target.rb | 2 |
2 files changed, 4 insertions, 2 deletions
diff --git a/lib/puppet/type/file.rb b/lib/puppet/type/file.rb index 6d71abce0..04a676589 100644 --- a/lib/puppet/type/file.rb +++ b/lib/puppet/type/file.rb @@ -30,8 +30,8 @@ Puppet::Type.newtype(:file) do validate do |value| # accept various path syntaxes: lone slash, posix, win32, unc - unless value =~ /^\/$/ or value =~ /^\/[^\/]/ or value =~ /^.:\// or value =~ /^\/\/[^\/]+\/[^\/]+/ - fail Puppet::Error,"File paths must be fully qualified, not '#{value}'" + unless (Puppet.features.posix? and (value =~ /^\/$/ or value =~ /^\/[^\/]/)) or (Puppet.features.win32? and (value =~ /^.:\// or value =~ /^\/\/[^\/]+\/[^\/]+/)) + fail Puppet::Error, "File paths must be fully qualified, not '#{value}'" end end diff --git a/lib/puppet/type/file/target.rb b/lib/puppet/type/file/target.rb index fe547e498..6987328b6 100644 --- a/lib/puppet/type/file/target.rb +++ b/lib/puppet/type/file/target.rb @@ -23,6 +23,8 @@ module Puppet # Create our link. def mklink + raise Puppet::Error, "Cannot symlink on Win32" if Puppet.features.win32? + target = self.should # Clean up any existing objects. The argument is just for logging, |