Skip to content

Commit

Permalink
DNS Made Easy fix locale for date string (ansible#44624)
Browse files Browse the repository at this point in the history
  • Loading branch information
EagleIJoe authored and resmo committed May 26, 2019
1 parent 6a50c6a commit d5ab712
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions changelogs/fragments/44624-dnsmadeeasy-fix_locale.yaml
Original file line number Diff line number Diff line change
@@ -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
2 changes: 2 additions & 0 deletions lib/ansible/modules/net_tools/dnsmadeeasy.py
Original file line number Diff line number Diff line change
Expand Up @@ -367,6 +367,7 @@
import json
import hashlib
import hmac
import locale
from time import strftime, gmtime

from ansible.module_utils.basic import AnsibleModule
Expand Down Expand Up @@ -414,6 +415,7 @@ def _headers(self):
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):
Expand Down

0 comments on commit d5ab712

Please sign in to comment.