@@ -50,7 +50,7 @@ def read
50
50
return ''
51
51
end
52
52
53
- Puppet ::Util ::Execution . execute ( "#{ cmdbase } -l" , failonfail : true , combine : true )
53
+ Puppet ::Util ::Execution . execute ( "#{ cmdbase } -l" , failonfail : true , combine : true ) . to_s
54
54
rescue => detail
55
55
case detail . to_s
56
56
when %r{no crontab for}
@@ -71,7 +71,7 @@ def remove
71
71
cmd = "/bin/echo yes | #{ cmd } "
72
72
end
73
73
74
- Puppet ::Util ::Execution . execute ( cmd , failonfail : true , combine : true )
74
+ Puppet ::Util ::Execution . execute ( cmd , failonfail : true , combine : true ) . to_s
75
75
end
76
76
77
77
# Overwrite a specific @path's cron tab; must be passed the @path name
@@ -113,7 +113,7 @@ def read
113
113
return ''
114
114
end
115
115
116
- Puppet ::Util ::Execution . execute ( [ 'crontab' , '-l' ] , cronargs )
116
+ Puppet ::Util ::Execution . execute ( [ 'crontab' , '-l' ] , cronargs ) . to_s
117
117
rescue => detail
118
118
case detail . to_s
119
119
when %r{can't open your crontab}
@@ -129,7 +129,7 @@ def read
129
129
130
130
# Remove a specific @path's cron tab.
131
131
def remove
132
- Puppet ::Util ::Execution . execute ( [ 'crontab' , '-r' ] , cronargs )
132
+ Puppet ::Util ::Execution . execute ( [ 'crontab' , '-r' ] , cronargs ) . to_s
133
133
rescue => detail
134
134
raise FileReadError , _ ( 'Could not remove crontab for %{path}: %{detail}' ) % { path : @path , detail : detail } , detail . backtrace
135
135
end
@@ -144,7 +144,7 @@ def write(text)
144
144
output_file . close
145
145
# We have to chown the stupid file to the user.
146
146
File . chown ( Puppet ::Util . uid ( @path ) , nil , output_file . path )
147
- Puppet ::Util ::Execution . execute ( [ 'crontab' , output_file . path ] , cronargs )
147
+ Puppet ::Util ::Execution . execute ( [ 'crontab' , output_file . path ] , cronargs ) . to_s
148
148
rescue => detail
149
149
raise FileReadError , _ ( 'Could not write crontab for %{path}: %{detail}' ) % { path : @path , detail : detail } , detail . backtrace
150
150
ensure
@@ -164,7 +164,7 @@ def read
164
164
return ''
165
165
end
166
166
167
- Puppet ::Util ::Execution . execute ( [ 'crontab' , '-l' ] , cronargs )
167
+ Puppet ::Util ::Execution . execute ( [ 'crontab' , '-l' ] , cronargs ) . to_s
168
168
rescue => detail
169
169
case detail . to_s
170
170
when %r{open.*in.*directory}
@@ -180,7 +180,7 @@ def read
180
180
181
181
# Remove a specific @path's cron tab.
182
182
def remove
183
- Puppet ::Util ::Execution . execute ( [ 'crontab' , '-r' ] , cronargs )
183
+ Puppet ::Util ::Execution . execute ( [ 'crontab' , '-r' ] , cronargs ) . to_s
184
184
rescue => detail
185
185
raise FileReadError , _ ( 'Could not remove crontab for %{path}: %{detail}' ) % { path : @path , detail : detail } , detail . backtrace
186
186
end
@@ -196,7 +196,7 @@ def write(text)
196
196
output_file . close
197
197
# We have to chown the stupid file to the user.
198
198
File . chown ( Puppet ::Util . uid ( @path ) , nil , output_file . path )
199
- Puppet ::Util ::Execution . execute ( [ 'crontab' , output_file . path ] , cronargs )
199
+ Puppet ::Util ::Execution . execute ( [ 'crontab' , output_file . path ] , cronargs ) . to_s
200
200
rescue => detail
201
201
raise FileReadError , _ ( 'Could not write crontab for %{path}: %{detail}' ) % { path : @path , detail : detail } , detail . backtrace
202
202
ensure
0 commit comments