libcloud-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From to...@apache.org
Subject svn commit: r1431200 - /libcloud/trunk/libcloud/dns/drivers/dummy.py
Date Thu, 10 Jan 2013 07:59:48 GMT
Author: tomaz
Date: Thu Jan 10 07:59:48 2013
New Revision: 1431200

URL: http://svn.apache.org/viewvc?rev=1431200&view=rev
Log:
Fix list_records method in the dummy DNS driver.

Contributed by John Carr.

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

Modified: libcloud/trunk/libcloud/dns/drivers/dummy.py
URL: http://svn.apache.org/viewvc/libcloud/trunk/libcloud/dns/drivers/dummy.py?rev=1431200&r1=1431199&r2=1431200&view=diff
==============================================================================
--- libcloud/trunk/libcloud/dns/drivers/dummy.py (original)
+++ libcloud/trunk/libcloud/dns/drivers/dummy.py Thu Jan 10 07:59:48 2013
@@ -67,7 +67,18 @@ class DummyDNSDriver(DNSDriver):
         return [zone['zone'] for zone in list(self._zones.values())]
 
     def list_records(self, zone):
-        return self.get_zone(zone_id=zone.id).records
+        """
+        >>> driver = DummyDNSDriver('key', 'secret')
+        >>> zone = driver.create_zone(domain='apache.org', type='master',
+        ...                           ttl=100)
+        >>> list(zone.list_records())
+        []
+        >>> record = driver.create_record(name='libcloud', zone=zone,
+        ...                               type=RecordType.A, data='127.0.0.1')
+        >>> list(zone.list_records()) #doctest: +ELLIPSIS
+        [<Record: zone=id-apache.org, name=libcloud, type=A...>]
+        """
+        return self._zones[zone.id]['records'].values()
 
     def get_zone(self, zone_id):
         """



Mime
View raw message