I'm using irange to check the age of a file, and based on that, it defines a class
Here is the code snippet:
- The aim of this promise is to create a class when this file is older
- than one hour. The class can not be created without touching but in
- order to not modifing the mtime we use WarnOnly.
file_select => over_an_hour,
touch => "true",
action => WarnOnly,
classes => success("last_successful_inputs_update_too_old", "last_successful_inputs_update_check_error", "last_successful_inputs_update_ok");
body file_select over_an_hour()
- Select file which are older than one hour
- Use of positive mtime instead of negative one
- In order to avoid corner effects
mtime => irange(ago(0,0,0,1,0,0), now);
file_result => "!mtime";
It used to work fine, and then suddently it didn't (end of august, and then during all september). I am suspecting an issue with the date format (my Windows as US locale) (i've been waiting before reporting to check if it would repair itself or not based on the date)
Here is the output of the promise
PS C:\Users\Administrator> cf-agent.exe -KIf failsafe.cf
2014-09-28T07:23:05Romance Daylight Time error: /default/check_lock_db_problem/files: Fatal CFEngine error: In function 'irange', 'Integer is out of range'
2014-09-28T07:23:05Romance Daylight Time error: Policy failed validation with command '"C:\Program Files\Cfengine\bin\cf-promises.exe" -c "C:\Program Files\Cfengine\inputs\failsafe.cf"'
PS C:\Users\Administrator> cf-agent.exe -V
CFEngine Core 220.127.116.1166e17
CFEngine Enterprise 3.6.1.e9fc5b3