1
0
mirror of https://github.com/github/octodns.git synced 2024-05-11 05:55:00 +00:00

Unroll the list comprehensions

This commit is contained in:
cclauss
2019-07-13 23:49:09 +02:00
parent 158add8eb6
commit c8b261a409
3 changed files with 14 additions and 6 deletions

View File

@@ -275,10 +275,13 @@ class Manager(object):
self.log.info('sync: sources=%s -> targets=%s', sources, targets)
try:
sources = [self.providers[source] for source in sources]
except KeyError as e:
collected = []
for source in sources:
collected.append(self.providers[source])
sources = collected
except KeyError:
raise Exception('Zone {}, unknown source: {}'.format(zone_name,
e))
source))
try:
trgs = []
@@ -396,10 +399,13 @@ class Manager(object):
raise Exception('Zone {} is missing sources'.format(zone_name))
try:
sources = [self.providers[source] for source in sources]
except KeyError as e:
collected = []
for source in sources:
collected.append(self.providers[source])
sources = collected
except KeyError:
raise Exception('Zone {}, unknown source: {}'.format(zone_name,
e))
source))
for source in sources:
if isinstance(source, YamlProvider):

View File

@@ -20,6 +20,7 @@ from ..record import Record, Update
from ..record.geo import GeoCodes
from .base import BaseProvider
# TODO: remove when Python 2.x is no longer supported
try:
cmp
except NameError:

View File

@@ -13,6 +13,7 @@ from six import string_types, text_type
from .geo import GeoCodes
# TODO: remove when Python 2.x is no longer supported
try:
cmp
except NameError: