forked from pyinfra-dev/pyinfra
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
pyinfra/operations: fix crontab comparison
The Crontab fact tries to convert numerical values from 'str' to 'int', but the crontab operation was doing a direct comparison of the values provided (whether they were strings or ints). Mimic what the Crontab fact does and use 'try_int' to compare. Also, add a test to confirm this behaviour doesn't regress. Signed-off-by: Andrew Dunham <[email protected]>
- Loading branch information
Showing
2 changed files
with
27 additions
and
5 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
{ | ||
"args": ["this_is_a_command"], | ||
"kwargs": { | ||
"minute": "0", | ||
"hour": "0" | ||
}, | ||
"facts": { | ||
"server.Crontab": { | ||
"user=None": { | ||
"this_is_a_command": { | ||
"minute": 0, | ||
"hour": 0, | ||
"month": "*", | ||
"day_of_week": "*", | ||
"day_of_month": "*" | ||
} | ||
} | ||
} | ||
}, | ||
"commands": [], | ||
"noop_description": "crontab this_is_a_command exists" | ||
} |