-
Notifications
You must be signed in to change notification settings - Fork 59
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #64 from mhedgpeth/interval-fixes
Merged interval functionality into default.rb recipe, updated documentation, gave quiet default
- Loading branch information
Showing
8 changed files
with
73 additions
and
111 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
# encoding: utf-8 | ||
|
||
def last_run(profile, interval) | ||
def profile_overdue_to_run?(profile, interval) | ||
# Calculate when the profile was last run so we delay it's next run if necessary | ||
return false unless ::File.exist?("#{compliance_cache_directory}/#{profile}") | ||
compliance_cache_directory = ::File.join(Chef::Config[:file_cache_path], 'compliance') | ||
lastrun = Time.now - ::File.mtime("#{compliance_cache_directory}/#{profile}") | ||
lastrun < interval | ||
return true unless ::File.exist?("#{compliance_cache_directory}/#{profile}") | ||
seconds_since_last_run = Time.now - ::File.mtime("#{compliance_cache_directory}/#{profile}") | ||
seconds_since_last_run > interval | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.