summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJames Cammarata <jimi@sngx.net>2014-03-12 20:45:51 -0500
committerMichael DeHaan <michael.dehaan@gmail.com>2014-03-13 07:50:11 -0400
commit763235a83da51932f5c92c32be27807347db89bd (patch)
tree1a84ac5f3dad056b2e5aa00a95ce3286633de474
parentb48940650733c5e0f3a7f584f7be0641ddf538ad (diff)
downloadansible-763235a83da51932f5c92c32be27807347db89bd.tar.gz
Fix regression in dnsmadeeasy module caused by fetch_url change
Also: * changed this module to use https for requests to the API * fixed a bug in which a traceback was caused when the domain wasn't found Fixes #6457
-rw-r--r--library/net_infrastructure/dnsmadeeasy8
1 files changed, 4 insertions, 4 deletions
diff --git a/library/net_infrastructure/dnsmadeeasy b/library/net_infrastructure/dnsmadeeasy
index 6b4fe1dcdb..148e25a501 100644
--- a/library/net_infrastructure/dnsmadeeasy
+++ b/library/net_infrastructure/dnsmadeeasy
@@ -129,7 +129,7 @@ class DME2:
self.api = apikey
self.secret = secret
- self.baseurl = 'http://api.dnsmadeeasy.com/V2.0/'
+ self.baseurl = 'https://api.dnsmadeeasy.com/V2.0/'
self.domain = str(domain)
self.domain_map = None # ["domain_name"] => ID
self.record_map = None # ["record_name"] => ID
@@ -161,14 +161,14 @@ class DME2:
if data and not isinstance(data, basestring):
data = urllib.urlencode(data)
- response, info = fetch_url(self.module, url, data=data, method=method)
+ response, info = fetch_url(self.module, url, data=data, method=method, headers=self._headers())
if info['status'] not in (200, 201, 204):
self.module.fail_json(msg="%s returned %s, with body: %s" % (url, info['status'], info['msg']))
try:
return json.load(response)
except Exception, e:
- return False
+ return {}
def getDomain(self, domain_id):
if not self.domain_map:
@@ -268,7 +268,7 @@ def main():
domain_records = DME.getRecords()
if not domain_records:
module.fail_json(
- msg="The %s domain name is not accessible with this api_key; try using its ID if known." % domain)
+ msg="The requested domain name is not accessible with this api_key; try using its ID if known.")
module.exit_json(changed=False, result=domain_records)
# Fetch existing record + Build new one