mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-06 13:22:48 +00:00
Add python level locale handling back (#31339)
locale.setlocale() call removed in 6b5291d68f150c629e9958bb6e910b529b0d8cef is actually needed by time.strptime(). AnsibleModule() changes both: environment variables and python level locale settings so both need to be reset.
This commit is contained in:
committed by
Sam Doran
parent
cbf28c20cb
commit
fd4a6cf7ad
@@ -155,6 +155,7 @@ import binascii
|
||||
import copy
|
||||
import hashlib
|
||||
import json
|
||||
import locale
|
||||
import os
|
||||
import re
|
||||
import shutil
|
||||
@@ -805,6 +806,7 @@ def main():
|
||||
|
||||
# AnsibleModule() changes the locale, so change it back to C because we rely on time.strptime() when parsing certificate dates.
|
||||
module.run_command_environ_update = dict(LANG='C', LC_ALL='C', LC_MESSAGES='C', LC_CTYPE='C')
|
||||
locale.setlocale(locale.LC_ALL, 'C')
|
||||
|
||||
cert_days = get_cert_days(module, module.params['dest'])
|
||||
if cert_days < module.params['remaining_days']:
|
||||
|
||||
Reference in New Issue
Block a user