mirror of
https://github.com/ansible/awx.git
synced 2026-01-15 03:40:42 -03:30
AC-1182 Handle a schedule rrule that results in zero occurrences.
This commit is contained in:
parent
fd1e35c6d9
commit
e8b0d7451e
@ -93,7 +93,10 @@ class Schedule(CommonModel):
|
||||
next_run_actual = future_rs.after(now())
|
||||
|
||||
self.next_run = next_run_actual
|
||||
self.dtstart = future_rs[0]
|
||||
try:
|
||||
self.dtstart = future_rs[0]
|
||||
except IndexError:
|
||||
self.dtstart = None
|
||||
self.dtend = None
|
||||
if 'until' in self.rrule.lower():
|
||||
match_until = re.match(".*?(UNTIL\=[0-9]+T[0-9]+Z)", self.rrule)
|
||||
|
||||
@ -35,7 +35,8 @@ GOOD_SCHEDULES = ["DTSTART:20500331T055000Z RRULE:FREQ=MINUTELY;INTERVAL=10;COUN
|
||||
"DTSTART:20140331T075000Z RRULE:FREQ=YEARLY;INTERVAL=1;BYMONTH=4;BYMONTHDAY=1",
|
||||
"DTSTART:20140331T075000Z RRULE:FREQ=YEARLY;INTERVAL=1;BYSETPOS=-1;BYMONTH=8;BYDAY=SU",
|
||||
"DTSTART:20140331T075000Z RRULE:FREQ=WEEKLY;INTERVAL=1;UNTIL=20230401T075000Z;BYDAY=MO,WE,FR",
|
||||
"DTSTART:20140331T075000Z RRULE:FREQ=HOURLY;INTERVAL=1;UNTIL=20230610T075000Z"
|
||||
"DTSTART:20140331T075000Z RRULE:FREQ=HOURLY;INTERVAL=1;UNTIL=20230610T075000Z",
|
||||
"DTSTART:20140411T040000Z RRULE:FREQ=WEEKLY;INTERVAL=1;UNTIL=20140411T040000Z;BYDAY=WE",
|
||||
]
|
||||
BAD_SCHEDULES = ["", "DTSTART:20140331T055000 RRULE:FREQ=MINUTELY;INTERVAL=10;COUNT=5",
|
||||
"RRULE:FREQ=MINUTELY;INTERVAL=10;COUNT=5",
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user