You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@libcloud.apache.org by to...@apache.org on 2019/08/24 18:48:49 UTC
[libcloud] 02/04: Fix lint.
This is an automated email from the ASF dual-hosted git repository.
tomaz pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/libcloud.git
commit 6a78a085d917a00826c9393fc61a8142343fbdb9
Author: Tomaz Muraus <to...@tomaz.me>
AuthorDate: Sat Aug 24 20:34:14 2019 +0200
Fix lint.
---
libcloud/dns/drivers/powerdns.py | 15 +++++++--------
1 file changed, 7 insertions(+), 8 deletions(-)
diff --git a/libcloud/dns/drivers/powerdns.py b/libcloud/dns/drivers/powerdns.py
index 23557be..a505fa7 100644
--- a/libcloud/dns/drivers/powerdns.py
+++ b/libcloud/dns/drivers/powerdns.py
@@ -180,7 +180,7 @@ class PowerDNSDriver(DNSDriver):
zone.id)
if extra is None or extra.get('ttl', None) is None:
raise ValueError('PowerDNS requires a ttl value for every record')
-
+
if self._pdns_version() == 3:
record = {
'content': data,
@@ -195,7 +195,7 @@ class PowerDNSDriver(DNSDriver):
'records': [record]
}]
}
-
+
if self._pdns_version() == 4:
disabled = False
if 'disabled' in extra:
@@ -438,12 +438,11 @@ class PowerDNSDriver(DNSDriver):
'records': [updated_record]
}]
}
-
+
if self._pdns_version() == 4:
disabled = False
if "disabled" in extra:
disabled = extra['disabled']
- comment = None
updated_record = {
'content': data,
'disabled': disabled,
@@ -461,7 +460,7 @@ class PowerDNSDriver(DNSDriver):
if 'comment' in extra:
payload["rrsets"][0]["comments"] = extra['comment']
-
+
try:
self.connection.request(action=action, data=json.dumps(payload),
method='PATCH')
@@ -491,7 +490,7 @@ class PowerDNSDriver(DNSDriver):
zones.append(self._to_zone(item))
return zones
- def _to_record(self, item, zone, record = None):
+ def _to_record(self, item, zone, record=None):
if record is None:
data = item['content']
else:
@@ -510,8 +509,8 @@ class PowerDNSDriver(DNSDriver):
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
if self.api_root == '/api/v1': return 4
- raise ValueError('PowerDNS version has not been declared')
\ No newline at end of file
+ raise ValueError('PowerDNS version has not been declared')