DNS Made Easy fix locale for date string (#44624)

This commit is contained in:
Martin Adler 2019-05-26 23:49:17 +02:00 committed by René Moser
parent 6a50c6aae4
commit d5ab712fad
2 changed files with 4 additions and 0 deletions

View file

@ -0,0 +1,2 @@
bugfixes:
- dnsmadeeasy - force the date to be rendered with C (POSIX system default) locale as English short date names are required by API

View file

@ -367,6 +367,7 @@ EXAMPLES = '''
import json import json
import hashlib import hashlib
import hmac import hmac
import locale
from time import strftime, gmtime from time import strftime, gmtime
from ansible.module_utils.basic import AnsibleModule from ansible.module_utils.basic import AnsibleModule
@ -414,6 +415,7 @@ class DME2(object):
return headers return headers
def _get_date(self): def _get_date(self):
locale.setlocale(locale.LC_TIME, 'C')
return strftime("%a, %d %b %Y %H:%M:%S GMT", gmtime()) return strftime("%a, %d %b %Y %H:%M:%S GMT", gmtime())
def _create_hash(self, rightnow): def _create_hash(self, rightnow):