Revert "Some missing isinstance checks". Pushed directly.

This reverts commit 2a7dd73710.
This commit is contained in:
Pedro Algarvio 2018-03-14 14:01:22 +00:00
parent 2a7dd73710
commit 78c0b77afd
No known key found for this signature in database
GPG Key ID: BB36BF6584A298FF

View File

@ -1010,9 +1010,6 @@ class Schedule(object):
except ValueError:
log.error('Invalid date string. Ignoring')
continue
else:
if isinstance(i, datetime.datetime):
when__ = i
else:
try:
when__ = dateutil_parser.parse(i)
@ -1193,15 +1190,11 @@ class Schedule(object):
continue
else:
if isinstance(data['range'], dict):
start = data['range']['start']
end = data['range']['start']
if not isinstance(range_start, datetime.datetime):
try:
start = dateutil_parser.parse(start)
start = dateutil_parser.parse(data['range']['start'])
except ValueError:
log.error('Invalid date string for start. Ignoring job %s.', job)
continue
if not isinstance(end, datetime.datetime):
try:
end = dateutil_parser.parse(data['range']['end'])
except ValueError:
@ -1342,9 +1335,7 @@ class Schedule(object):
log.error('Missing python-dateutil. '
'Ignoring until.')
else:
until = data['until']
if not isinstance(until, datetime.datetime):
until = dateutil_parser.parse(until)
until = dateutil_parser.parse(data['until'])
if until <= now:
log.debug(
@ -1361,8 +1352,6 @@ class Schedule(object):
log.error('Missing python-dateutil. '
'Ignoring after.')
else:
after = data['after']
if not isinstance(after, datetime.datetime):
after = dateutil_parser.parse(data['after'])
if after >= now: