macfreek opened a new pull request #1535:
URL: https://github.com/apache/libcloud/pull/1535


   ## Provide correct TTL for records in in `export_zone_to_bind_format()`
   
   ### Description
   
   `libcloud.dns.base.DNSDriver.export_zone_to_bind_format()` does not 
correctly list the TTL of individual DNS records if the TTL is different from 
the default TTL of the zone.
   
   The root cause is a bug in [line 
549](https://github.com/macfreek/libcloud/blob/trunk/libcloud/dns/base.py#L549) 
in the `_get_bind_record_line()` method.
   
   When it tries to find the TTL for the record, it is looking for it in the 
`extra` dict, while in reality, the TTL (if different from the default) is 
stored in an attribute, `Record.ttl`, as can be seen in the [`__init__` method 
of 
`libcloud.dns.base.Record`](https://github.com/macfreek/libcloud/blob/trunk/libcloud/dns/base.py#L163).
   
   As far as I can see, the ttl is never stored in the `extra` dict, so this if 
statement is always false, and the zone default TTL is always picked, even in 
case the Record does have a more specific TTL.
   
   ### Status
   
   - done, ready for review
   - may need additional unit test
   
   ### Classification
   
   Suggested labels: `bug fix`, `api: dns`
   
   ### Checklist (tick everything that applies)
   
   - [X] [Code 
linting](http://libcloud.readthedocs.org/en/latest/development.html#code-style-guide)
 (required, can be done after the PR checks)
   - [X] Documentation (existing documentation suffices, this is only a small 
bug fix)
   - [ ] [Tests](http://libcloud.readthedocs.org/en/latest/testing.html)
   - [N/A] 
[ICLA](http://libcloud.readthedocs.org/en/latest/development.html#contributing-bigger-changes)
 (required for bigger changes)
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to