diff --git a/changelogs/fragments/44624-dnsmadeeasy-fix_locale.yaml b/changelogs/fragments/44624-dnsmadeeasy-fix_locale.yaml new file mode 100644 index 0000000000..12536623cd --- /dev/null +++ b/changelogs/fragments/44624-dnsmadeeasy-fix_locale.yaml @@ -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 diff --git a/lib/ansible/modules/net_tools/dnsmadeeasy.py b/lib/ansible/modules/net_tools/dnsmadeeasy.py index d051f3d5b1..31186898f7 100644 --- a/lib/ansible/modules/net_tools/dnsmadeeasy.py +++ b/lib/ansible/modules/net_tools/dnsmadeeasy.py @@ -367,6 +367,7 @@ EXAMPLES = ''' import json import hashlib import hmac +import locale from time import strftime, gmtime from ansible.module_utils.basic import AnsibleModule @@ -414,6 +415,7 @@ class DME2(object): return headers def _get_date(self): + locale.setlocale(locale.LC_TIME, 'C') return strftime("%a, %d %b %Y %H:%M:%S GMT", gmtime()) def _create_hash(self, rightnow):