libcloud-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From anthonys...@apache.org
Subject libcloud git commit: Following fixes were done: Only MX and SRV records have pririoty. Content-type for data has to be json. data param of connection request must be string, changed that. Closes #775
Date Thu, 28 Apr 2016 22:23:38 GMT
Repository: libcloud
Updated Branches:
  refs/heads/trunk 5c09af271 -> a2682566b


Following fixes were done: Only MX and SRV records have pririoty. Content-type for data has
to be json. data param of connection request must be string, changed that.   Closes #775


Project: http://git-wip-us.apache.org/repos/asf/libcloud/repo
Commit: http://git-wip-us.apache.org/repos/asf/libcloud/commit/a2682566
Tree: http://git-wip-us.apache.org/repos/asf/libcloud/tree/a2682566
Diff: http://git-wip-us.apache.org/repos/asf/libcloud/diff/a2682566

Branch: refs/heads/trunk
Commit: a2682566b54abec53f38084ae4883a2989b17655
Parents: 5c09af2
Author: Teemu Vesala <Teemu.Vesala@qentinel.com>
Authored: Mon Apr 25 07:00:30 2016 +0000
Committer: anthony-shaw <anthonyshaw@apache.org>
Committed: Thu Apr 28 18:23:24 2016 -0400

----------------------------------------------------------------------
 libcloud/dns/drivers/godaddy.py | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/libcloud/blob/a2682566/libcloud/dns/drivers/godaddy.py
----------------------------------------------------------------------
diff --git a/libcloud/dns/drivers/godaddy.py b/libcloud/dns/drivers/godaddy.py
index 62c21d6..21cd2b8 100644
--- a/libcloud/dns/drivers/godaddy.py
+++ b/libcloud/dns/drivers/godaddy.py
@@ -89,6 +89,7 @@ class GoDaddyDNSConnection(ConnectionKey):
     def add_default_headers(self, headers):
         if self.shopper_id is not None:
             headers['X-Shopper-Id'] = self.shopper_id
+        headers['Content-type'] = 'application/json'
         headers['Authorization'] = "sso-key %s:%s" % \
             (self.key, self.secret)
         return headers
@@ -189,7 +190,7 @@ class GoDaddyDNSDriver(DNSDriver):
         new_record = self._format_record(name, type, data, extra)
         self.connection.request(
             '/v1/domains/%s/records' % (zone.domain), method='PATCH',
-            data=[new_record])
+            data=json.dumps([new_record]))
         id = self._get_id_of_record(name, type)
         return Record(
             id=id, name=name,
@@ -228,7 +229,7 @@ class GoDaddyDNSDriver(DNSDriver):
                                               record.type,
                                               record.name),
             method='PUT',
-            data=[new_record])
+            data=json.dumps([new_record]))
         id = self._get_id_of_record(name, type)
         return Record(
             id=id, name=name,
@@ -420,9 +421,10 @@ class GoDaddyDNSDriver(DNSDriver):
                 'type': type,
                 'name': name,
                 'data': data,
-                'priority': 1,
                 'ttl': extra.get('ttl', 5)
             }
+        if type == RecordType.MX:
+            new_record['priority'] = 1
         return new_record
 
     def _to_zones(self, items):


Mime
View raw message