daemon: bind: cosmetic: yapf, isort formatting

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
This commit is contained in:
Sunil Mohan Adapa 2020-05-07 20:26:57 -07:00 committed by James Valleroy
parent e3228467f3
commit b763391dfb
No known key found for this signature in database
GPG Key ID: 77C0C75E7B650808
2 changed files with 8 additions and 9 deletions

View File

@ -14,6 +14,7 @@ from plinth import action_utils, actions, app
class Daemon(app.LeaderComponent): class Daemon(app.LeaderComponent):
"""Component to manage a background daemon or any systemd unit.""" """Component to manage a background daemon or any systemd unit."""
def __init__(self, component_id, unit, strict_check=False, def __init__(self, component_id, unit, strict_check=False,
listen_ports=None, alias=None): listen_ports=None, alias=None):
"""Initialize a new daemon component. """Initialize a new daemon component.

View File

@ -3,11 +3,11 @@
FreedomBox app to configure BIND server. FreedomBox app to configure BIND server.
""" """
import augeas
import re import re
from collections import defaultdict from collections import defaultdict
from pathlib import Path from pathlib import Path
import augeas
from django.utils.translation import ugettext_lazy as _ from django.utils.translation import ugettext_lazy as _
from plinth import actions from plinth import actions
@ -233,8 +233,8 @@ def get_served_domains():
:return: dictionary in the form 'domain_name': ['ip_address', 'ipv6_addr'] :return: dictionary in the form 'domain_name': ['ip_address', 'ipv6_addr']
""" """
RECORD_TYPES = ('A', 'AAAA') RECORD_TYPES = ('A', 'AAAA')
aug = augeas.Augeas( aug = augeas.Augeas(flags=augeas.Augeas.NO_LOAD +
flags=augeas.Augeas.NO_LOAD + augeas.Augeas.NO_MODL_AUTOLOAD) augeas.Augeas.NO_MODL_AUTOLOAD)
aug.set('/augeas/load/Dns_Zone/lens', 'Dns_Zone.lns') aug.set('/augeas/load/Dns_Zone/lens', 'Dns_Zone.lns')
zone_file_path = Path(ZONES_DIR) zone_file_path = Path(ZONES_DIR)
@ -252,8 +252,8 @@ def get_served_domains():
count = 1 count = 1
mname = aug.get(base_path.format(record_order=count, field='mname')) mname = aug.get(base_path.format(record_order=count, field='mname'))
while True: while True:
record_type = aug.get(base_path.format(record_order=count, record_type = aug.get(
field='type')) base_path.format(record_order=count, field='type'))
# no record type ends the search # no record type ends the search
if record_type is None: if record_type is None:
@ -261,10 +261,8 @@ def get_served_domains():
if record_type in RECORD_TYPES: if record_type in RECORD_TYPES:
served_domains[mname].append( served_domains[mname].append(
aug.get(base_path.format( aug.get(base_path.format(record_order=count,
record_order=count, field='rdata') field='rdata')))
)
)
count += 1 count += 1