From b763391dfb82bf9a8be66a46707cf0b725aef4fc Mon Sep 17 00:00:00 2001 From: Sunil Mohan Adapa Date: Thu, 7 May 2020 20:26:57 -0700 Subject: [PATCH] daemon: bind: cosmetic: yapf, isort formatting Signed-off-by: Sunil Mohan Adapa Reviewed-by: James Valleroy --- plinth/daemon.py | 1 + plinth/modules/bind/__init__.py | 16 +++++++--------- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/plinth/daemon.py b/plinth/daemon.py index 3b80d8a2a..eb64eba3b 100644 --- a/plinth/daemon.py +++ b/plinth/daemon.py @@ -14,6 +14,7 @@ from plinth import action_utils, actions, app class Daemon(app.LeaderComponent): """Component to manage a background daemon or any systemd unit.""" + def __init__(self, component_id, unit, strict_check=False, listen_ports=None, alias=None): """Initialize a new daemon component. diff --git a/plinth/modules/bind/__init__.py b/plinth/modules/bind/__init__.py index e20979da1..80f0dc70e 100644 --- a/plinth/modules/bind/__init__.py +++ b/plinth/modules/bind/__init__.py @@ -3,11 +3,11 @@ FreedomBox app to configure BIND server. """ -import augeas import re from collections import defaultdict from pathlib import Path +import augeas from django.utils.translation import ugettext_lazy as _ from plinth import actions @@ -233,8 +233,8 @@ def get_served_domains(): :return: dictionary in the form 'domain_name': ['ip_address', 'ipv6_addr'] """ RECORD_TYPES = ('A', 'AAAA') - aug = augeas.Augeas( - flags=augeas.Augeas.NO_LOAD + augeas.Augeas.NO_MODL_AUTOLOAD) + aug = augeas.Augeas(flags=augeas.Augeas.NO_LOAD + + augeas.Augeas.NO_MODL_AUTOLOAD) aug.set('/augeas/load/Dns_Zone/lens', 'Dns_Zone.lns') zone_file_path = Path(ZONES_DIR) @@ -252,8 +252,8 @@ def get_served_domains(): count = 1 mname = aug.get(base_path.format(record_order=count, field='mname')) while True: - record_type = aug.get(base_path.format(record_order=count, - field='type')) + record_type = aug.get( + base_path.format(record_order=count, field='type')) # no record type ends the search if record_type is None: @@ -261,10 +261,8 @@ def get_served_domains(): if record_type in RECORD_TYPES: served_domains[mname].append( - aug.get(base_path.format( - record_order=count, field='rdata') - ) - ) + aug.get(base_path.format(record_order=count, + field='rdata'))) count += 1