libcloud-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From to...@apache.org
Subject svn commit: r1429553 - /libcloud/trunk/libcloud/dns/drivers/route53.py
Date Sun, 06 Jan 2013 16:46:51 GMT
Author: tomaz
Date: Sun Jan  6 16:46:51 2013
New Revision: 1429553

URL: http://svn.apache.org/viewvc?rev=1429553&view=rev
Log:
Add a docstring and move extenstion method to the end.

Modified:
    libcloud/trunk/libcloud/dns/drivers/route53.py

Modified: libcloud/trunk/libcloud/dns/drivers/route53.py
URL: http://svn.apache.org/viewvc/libcloud/trunk/libcloud/dns/drivers/route53.py?rev=1429553&r1=1429552&r2=1429553&view=diff
==============================================================================
--- libcloud/trunk/libcloud/dns/drivers/route53.py (original)
+++ libcloud/trunk/libcloud/dns/drivers/route53.py Sun Jan  6 16:46:51 2013
@@ -203,16 +203,6 @@ class Route53DNSDriver(DNSDriver):
         response = self.connection.request(uri, method='DELETE')
         return response.status in [httplib.OK]
 
-    def ex_delete_all_records(self, zone):
-        deletions = []
-        for r in zone.list_records():
-            if r.type in (RecordType.NS, RecordType.SOA):
-                continue
-            deletions.append(('DELETE', r.name, r.type, r.data, r.extra))
-
-        if deletions:
-            self._post_changeset(zone, deletions)
-
     def create_record(self, name, zone, type, data, extra=None):
         batch = [('CREATE', name, type, data, extra)]
         self._post_changeset(zone, batch)
@@ -239,6 +229,22 @@ class Route53DNSDriver(DNSDriver):
                                           record_id=r.id)
         return True
 
+    def ex_delete_all_records(self, zone):
+        """
+        Remove all the records for the provided zone.
+
+        @param zone: Zone to delete records for.
+        @type  zone: L{Zone}
+        """
+        deletions = []
+        for r in zone.list_records():
+            if r.type in (RecordType.NS, RecordType.SOA):
+                continue
+            deletions.append(('DELETE', r.name, r.type, r.data, r.extra))
+
+        if deletions:
+            self._post_changeset(zone, deletions)
+
     def _post_changeset(self, zone, changes_list):
         attrs = {'xmlns': NAMESPACE}
         changeset = ET.Element('ChangeResourceRecordSetsRequest', attrs)



Mime
View raw message