summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--persistent_crontab_minutes.rb5
1 files changed, 5 insertions, 0 deletions
diff --git a/persistent_crontab_minutes.rb b/persistent_crontab_minutes.rb
index 44c6328..5a76868 100644
--- a/persistent_crontab_minutes.rb
+++ b/persistent_crontab_minutes.rb
@@ -27,6 +27,11 @@ module Puppet::Parser::Functions
file = "/puppet/state/crontab/#{host}-#{job}.minutes"
file = File.join(modules, file)
+ # Get the directory portion from the file name ...
+ directory = File.dirname(file)
+
+ FileUtils.mkdir_p(directory) unless File.directory?(directory)
+
if FileTest.exists?(file)
File.open(file, 'r') { |f| value = f.read.to_i }