Skip to content

Commit

Permalink
letsencrypt: Locale-independent date parsing (ansible#3314)
Browse files Browse the repository at this point in the history
Should fix ansible#3155.
  • Loading branch information
mgedmin authored and mattclay committed Dec 8, 2016
1 parent 9453f6b commit cffd560
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/ansible/modules/extras/web_infrastructure/letsencrypt.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@

import binascii
import copy
import locale
import textwrap
from datetime import datetime

Expand Down Expand Up @@ -769,6 +770,9 @@ def main():
),
supports_check_mode = True,
)

# AnsibleModule() changes the locale, so change it back to C because we rely on time.strptime() when parsing certificate dates.
locale.setlocale(locale.LC_ALL, "C")

cert_days = get_cert_days(module,module.params['dest'])
if cert_days < module.params['remaining_days']:
Expand Down

0 comments on commit cffd560

Please sign in to comment.