Kami commented on a change in pull request #1328: powerdns driver adapted to work with pdns 3 and 4 URL: https://github.com/apache/libcloud/pull/1328#discussion_r310354753
########## File path: libcloud/dns/drivers/powerdns.py ########## @@ -439,13 +485,27 @@ def _to_zones(self, items): zones.append(self._to_zone(item)) return zones - def _to_record(self, item, zone): - return Record(id=None, name=item['name'], data=item['content'], + def _to_record(self, item, zone, record = None): + if record is None: + data = item['content'] + else: + data = record['content'] + return Record(id=None, name=item['name'], data=data, type=item['type'], zone=zone, driver=self, ttl=item['ttl']) def _to_records(self, items, zone): records = [] - for item in items.object['records']: - records.append(self._to_record(item, zone)) + if self._pdns_version() == 3: + for item in items.object['records']: + records.append(self._to_record(item, zone)) + if self._pdns_version() == 4: + for item in items.object['rrsets']: + for record in item['records']: + records.append(self._to_record(item, zone, record)) return records + + def _pdns_version(self): + if self.api_root == '': return 3 Review comment: EDIT: I see it's declared here - https://github.com/apache/libcloud/blob/9cab4689ac005fed2de0761174cf13981d525128/libcloud/dns/drivers/powerdns.py#L133 ---------------------------------------------------------------- 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: us...@infra.apache.org With regards, Apache Git Services