Repository: libcloud
Updated Branches:
  refs/heads/trunk c7e81a5f6 -> 95b087fd4


Fix Linode DNS records to have 'priority' in extra

'priority' extra field is being used in
DNSDriver._get_bind_record_line() for export_zone_to_bind_format()
Closes #1088


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

Branch: refs/heads/trunk
Commit: 0490cde9b2eee44683ad51ba6d9bf8e515ae4736
Parents: c7e81a5
Author: mete0r <met...@sarangbang.or.kr>
Authored: Tue Aug 8 01:52:45 2017 +0900
Committer: Anthony Shaw <anthonys...@apache.org>
Committed: Fri Aug 11 15:19:22 2017 +1000

----------------------------------------------------------------------
 libcloud/dns/drivers/linode.py   | 3 ++-
 libcloud/test/dns/test_linode.py | 9 +++++++++
 2 files changed, 11 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/libcloud/blob/0490cde9/libcloud/dns/drivers/linode.py
----------------------------------------------------------------------
diff --git a/libcloud/dns/drivers/linode.py b/libcloud/dns/drivers/linode.py
index 5d497ed..2089d4c 100644
--- a/libcloud/dns/drivers/linode.py
+++ b/libcloud/dns/drivers/linode.py
@@ -265,7 +265,8 @@ class LinodeDNSDriver(DNSDriver):
         Build a Record object from the item dictionary.
         """
         extra = {'protocol': item['PROTOCOL'], 'ttl_sec': item['TTL_SEC'],
-                 'port': item['PORT'], 'weight': item['WEIGHT']}
+                 'port': item['PORT'], 'weight': item['WEIGHT'],
+                 'priority': item['PRIORITY']}
         type = self._string_to_record_type(item['TYPE'])
         record = Record(id=item['RESOURCEID'], name=item['NAME'], type=type,
                         data=item['TARGET'], zone=zone, driver=self,

http://git-wip-us.apache.org/repos/asf/libcloud/blob/0490cde9/libcloud/test/dns/test_linode.py
----------------------------------------------------------------------
diff --git a/libcloud/test/dns/test_linode.py b/libcloud/test/dns/test_linode.py
index d197c1d..72da66c 100644
--- a/libcloud/test/dns/test_linode.py
+++ b/libcloud/test/dns/test_linode.py
@@ -68,6 +68,15 @@ class LinodeTests(unittest.TestCase):
         self.assertHasKeys(arecord.extra, ['protocol', 'ttl_sec', 'port',
                                            'weight'])
 
+        srvrecord = records[1]
+        self.assertEquals(srvrecord.id, '3585141')
+        self.assertEquals(srvrecord.name, '_minecraft._udp')
+        self.assertEquals(srvrecord.type, RecordType.SRV)
+        self.assertEquals(srvrecord.data, 'mc.linode.com')
+        self.assertHasKeys(srvrecord.extra, ['protocol', 'ttl_sec', 'port',
+                                             'priority', 'weight'])
+
+
     def test_list_records_zone_does_not_exist(self):
         zone = self.driver.list_zones()[0]
 

Reply via email to