Skip to content

Commit

Permalink
Merge pull request #1286 from aryoda/issues/1181_test_readWriteCrontab
Browse files Browse the repository at this point in the history
Closes #1181: test_readWriteCrontab fails when crontab is empty
  • Loading branch information
emtiu authored Sep 8, 2022
2 parents abd2a30 + e8b02bd commit f7cc1b7
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions common/tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -1234,6 +1234,8 @@ def readCrontab():
return []
else:
crontab = [x.strip() for x in out.strip('\n').split('\n')]
if crontab == ['']: # Fixes issue #1181 (line count of empty crontab was 1 instead of 0)
crontab = []
logger.debug('Read %s lines from users crontab'
%len(crontab))
return crontab
Expand Down

0 comments on commit f7cc1b7

Please sign in to comment.