libcloud-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From to...@apache.org
Subject libcloud git commit: Fixes LIBCLOUD-650: ex_create_multi_value_record only returns one record (route53 driver), adds tests for that function.
Date Sat, 17 Jan 2015 10:24:01 GMT
Repository: libcloud
Updated Branches:
  refs/heads/trunk ecd36734f -> eb36e6277


Fixes LIBCLOUD-650: ex_create_multi_value_record only returns one record (route53 driver),
adds tests for that function.

Signed-off-by: Tomaz Muraus <tomaz@apache.org>


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

Branch: refs/heads/trunk
Commit: eb36e62772de9d2becbd9a9013595c0f7f96ecd0
Parents: ecd3673
Author: Itxaka Serrano <itxakaserrano@gmail.com>
Authored: Sat Jan 10 11:23:34 2015 +0100
Committer: Tomaz Muraus <tomaz@apache.org>
Committed: Sat Jan 17 11:19:48 2015 +0100

----------------------------------------------------------------------
 CHANGES.rst                       |  5 +++++
 libcloud/dns/drivers/route53.py   |  3 +--
 libcloud/test/dns/test_route53.py | 20 ++++++++++++++++++++
 3 files changed, 26 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/libcloud/blob/eb36e627/CHANGES.rst
----------------------------------------------------------------------
diff --git a/CHANGES.rst b/CHANGES.rst
index d773d74..1a7bbfa 100644
--- a/CHANGES.rst
+++ b/CHANGES.rst
@@ -156,6 +156,11 @@ DNS
   (GITHUB-413, LIBCLOUD-640)
   [VanĨ Levstik]
 
+- Fix a bug with ``ex_create_multi_value_record`` method in the Route53 driver
+  only returning a single record.
+  (GITHUB-431, LIBCLOUD-650)
+  [Itxaka Serrano]
+
 Changes with Apache Libcloud 0.16.0
 -----------------------------------
 

http://git-wip-us.apache.org/repos/asf/libcloud/blob/eb36e627/libcloud/dns/drivers/route53.py
----------------------------------------------------------------------
diff --git a/libcloud/dns/drivers/route53.py b/libcloud/dns/drivers/route53.py
index f1a8f34..5fce731 100644
--- a/libcloud/dns/drivers/route53.py
+++ b/libcloud/dns/drivers/route53.py
@@ -273,7 +273,7 @@ class Route53DNSDriver(DNSDriver):
                             driver=self, extra=extra)
             records.append(record)
 
-        return record
+        return records
 
     def ex_delete_all_records(self, zone):
         """
@@ -346,7 +346,6 @@ class Route53DNSDriver(DNSDriver):
         for other_record in other_records:
             rrec = ET.SubElement(rrecs, 'ResourceRecord')
             ET.SubElement(rrec, 'Value').text = other_record['data']
-
         uri = API_ROOT + 'hostedzone/' + record.zone.id + '/rrset'
         data = ET.tostring(changeset)
         self.connection.set_context({'zone_id': record.zone.id})

http://git-wip-us.apache.org/repos/asf/libcloud/blob/eb36e627/libcloud/test/dns/test_route53.py
----------------------------------------------------------------------
diff --git a/libcloud/test/dns/test_route53.py b/libcloud/test/dns/test_route53.py
index 2994203..e9a4026 100644
--- a/libcloud/test/dns/test_route53.py
+++ b/libcloud/test/dns/test_route53.py
@@ -155,6 +155,26 @@ class Route53Tests(unittest.TestCase):
         self.assertEqual(record.type, RecordType.A)
         self.assertEqual(record.data, '127.0.0.1')
 
+    def test_create_multi_value_record(self):
+        zone = self.driver.list_zones()[0]
+        records = self.driver.ex_create_multi_value_record(
+            name='balancer', zone=zone,
+            type=RecordType.A, data='127.0.0.1\n127.0.0.2',
+            extra={'ttl': 0}
+
+        )
+        self.assertEqual(len(records), 2)
+        self.assertEqual(records[0].id, 'A:balancer')
+        self.assertEqual(records[1].id, 'A:balancer')
+        self.assertEqual(records[0].name, 'balancer')
+        self.assertEqual(records[1].name, 'balancer')
+        self.assertEqual(records[0].zone, zone)
+        self.assertEqual(records[1].zone, zone)
+        self.assertEqual(records[0].type, RecordType.A)
+        self.assertEqual(records[1].type, RecordType.A)
+        self.assertEqual(records[0].data, '127.0.0.1')
+        self.assertEqual(records[1].data, '127.0.0.2')
+
     def test_update_record(self):
         zone = self.driver.list_zones()[0]
         record = self.driver.list_records(zone=zone)[1]


Mime
View raw message