File tree 2 files changed +9
-17
lines changed
2 files changed +9
-17
lines changed Original file line number Diff line number Diff line change @@ -82,8 +82,7 @@ module Puppet
82
82
self . set_directory
83
83
return :directory_created
84
84
else
85
- state . mklink
86
- return :link_created
85
+ return state . mklink
87
86
end
88
87
else
89
88
self . fail "Cannot create a symlink without a target"
Original file line number Diff line number Diff line change @@ -26,31 +26,24 @@ def mklink
26
26
27
27
case stat . ftype
28
28
when "directory" :
29
- # uh, bad stuff
30
- #self.fail "Not replacing directory"
31
29
FileUtils . rmtree ( @parent [ :path ] )
32
30
else
33
31
File . unlink ( @parent [ :path ] )
34
32
end
35
33
end
36
34
Dir . chdir ( File . dirname ( @parent [ :path ] ) ) do
37
- unless FileTest . exists? ( target )
38
- self . debug "Not linking to non-existent '%s'" % target
39
- :nochange # Grrr, can't return
40
- else
41
- Puppet ::Util . asuser ( @parent . asuser ( ) ) do
42
- mode = @parent . should ( :mode )
43
- if mode
44
- Puppet ::Util . withumask ( 000 ) do
45
- File . symlink ( target , @parent [ :path ] )
46
- end
47
- else
35
+ Puppet ::Util . asuser ( @parent . asuser ( ) ) do
36
+ mode = @parent . should ( :mode )
37
+ if mode
38
+ Puppet ::Util . withumask ( 000 ) do
48
39
File . symlink ( target , @parent [ :path ] )
49
40
end
41
+ else
42
+ File . symlink ( target , @parent [ :path ] )
50
43
end
51
-
52
- :link_created
53
44
end
45
+
46
+ :link_created
54
47
end
55
48
end
56
49
You can’t perform that action at this time.
0 commit comments