1
0
mirror of https://github.com/ansible/awx.git synced 2024-11-01 08:21:15 +03:00

Merge pull request #3829 from ansible/tz-fix

fix a tz parsing bug
This commit is contained in:
Ryan Petrello 2019-10-16 10:31:44 -04:00 committed by GitHub
commit a31e2bdac1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -119,10 +119,11 @@ class Schedule(PrimordialModel, LaunchTimeConfig):
tzinfo = r._dtstart.tzinfo
if tzinfo is utc:
return 'UTC'
fname = tzinfo._filename
for zone in all_zones:
if fname.endswith(zone):
return zone
fname = getattr(tzinfo, '_filename', None)
if fname:
for zone in all_zones:
if fname.endswith(zone):
return zone
logger.warn('Could not detect valid zoneinfo for {}'.format(self.rrule))
return ''