libcloud-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From to...@apache.org
Subject [04/12] libcloud git commit: Add "ttl" attribute to the Record class.
Date Wed, 25 Nov 2015 11:31:31 GMT
Add "ttl" attribute to the Record class.


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

Branch: refs/heads/cloudflare_dns_driver
Commit: 59049a68923391b42b371b27bd3799af2e04d133
Parents: ee4f7ef
Author: Tomaz Muraus <tomaz@tomaz.me>
Authored: Sun Nov 22 23:21:18 2015 +0100
Committer: Tomaz Muraus <tomaz@tomaz.me>
Committed: Sun Nov 22 23:21:18 2015 +0100

----------------------------------------------------------------------
 libcloud/dns/base.py | 13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/libcloud/blob/59049a68/libcloud/dns/base.py
----------------------------------------------------------------------
diff --git a/libcloud/dns/base.py b/libcloud/dns/base.py
index a3a5b1c..f557c85 100644
--- a/libcloud/dns/base.py
+++ b/libcloud/dns/base.py
@@ -91,7 +91,8 @@ class Record(object):
     Zone record / resource.
     """
 
-    def __init__(self, id, name, type, data, zone, driver, extra=None):
+    def __init__(self, id, name, type, data, zone, driver, ttl=None,
+                 extra=None):
         """
         :param id: Record id
         :type id: ``str``
@@ -111,6 +112,9 @@ class Record(object):
         :param driver: DNSDriver instance.
         :type driver: :class:`DNSDriver`
 
+        :param ttl: Record TTL.
+        :type ttl: ``int``
+
         :param extra: (optional) Extra attributes (driver specific).
         :type extra: ``dict``
         """
@@ -120,6 +124,7 @@ class Record(object):
         self.data = data
         self.zone = zone
         self.driver = driver
+        self.ttl = ttl
         self.extra = extra or {}
 
     def update(self, name=None, type=None, data=None, extra=None):
@@ -138,10 +143,10 @@ class Record(object):
         return record_id
 
     def __repr__(self):
-        return ('<Record: zone=%s, name=%s, type=%s, data=%s, provider=%s '
-                '...>' %
+        return ('<Record: zone=%s, name=%s, type=%s, data=%s, provider=%s, '
+                'ttl=%s ...>' %
                 (self.zone.id, self.name, self.type, self.data,
-                 self.driver.name))
+                 self.driver.name, self.ttl))
 
 
 class DNSDriver(BaseDriver):


Mime
View raw message