Repository: libcloud Updated Branches: refs/heads/trunk 330c2563e -> 56548a969
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/trunk Commit: 59049a68923391b42b371b27bd3799af2e04d133 Parents: ee4f7ef Author: Tomaz Muraus <[email protected]> Authored: Sun Nov 22 23:21:18 2015 +0100 Committer: Tomaz Muraus <[email protected]> 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):
