You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@libcloud.apache.org by to...@apache.org on 2016/03/01 16:26:42 UTC

[2/5] libcloud git commit: Fix syntax error, add a comment.

Fix syntax error, add a comment.

Closes #718


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

Branch: refs/heads/trunk
Commit: 1d0b2eeeb710ecbf3f65a34df3c38170a78a5216
Parents: f29960f
Author: Tomaz Muraus <to...@apache.org>
Authored: Tue Mar 1 15:55:15 2016 +0100
Committer: Tomaz Muraus <to...@apache.org>
Committed: Tue Mar 1 16:01:14 2016 +0100

----------------------------------------------------------------------
 libcloud/dns/drivers/gandi.py | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/libcloud/blob/1d0b2eee/libcloud/dns/drivers/gandi.py
----------------------------------------------------------------------
diff --git a/libcloud/dns/drivers/gandi.py b/libcloud/dns/drivers/gandi.py
index a7ca186..39a21e3 100644
--- a/libcloud/dns/drivers/gandi.py
+++ b/libcloud/dns/drivers/gandi.py
@@ -147,10 +147,13 @@ class GandiDNSDriver(BaseGandiDriver, DNSDriver):
         return res.object
 
     def _to_record(self, record, zone):
-        extras = {'ttl': record['ttl']}
+        extra = {'ttl': record['ttl']}
         value = record['value']
         if record['type'] == 'MX':
-            extras['priority'] = record['value'].split(' ')[0]
+            # Record is in the following form:
+            # <priority> <value>
+            # e.g. 15 aspmx.l.google.com
+            extra['priority'] = record['value'].split(' ')[0]
             value = record['value'].split(' ')[1]
         return Record(
             id='%s:%s' % (record['type'], record['name']),
@@ -160,7 +163,7 @@ class GandiDNSDriver(BaseGandiDriver, DNSDriver):
             zone=zone,
             driver=self,
             ttl=record['ttl'],
-            extra=extras
+            extra=extra)
 
     def _to_records(self, records, zone):
         retval = []