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

Apply suggestions from code review

Co-Authored-By: Theo Julienne <theojulienne@github.com>
This commit is contained in:
Ross McFarland
2019-10-14 07:32:09 -07:00
committed by GitHub
parent c788681e7c
commit b3bd4382cc
3 changed files with 6 additions and 2 deletions

View File

@@ -283,6 +283,8 @@ class Manager(object):
self.log.info('sync: sources=%s -> targets=%s', sources, targets)
try:
# rather than using a list comprehension, we break this loop out
# so that the `except` block below can reference the `source`
collected = []
for source in sources:
collected.append(self.providers[source])
@@ -408,6 +410,8 @@ class Manager(object):
.format(zone_name))
try:
# rather than using a list comprehension, we break this loop out
# so that the `except` block below can reference the `source`
collected = []
for source in sources:
collected.append(self.providers[source])

View File

@@ -14,7 +14,7 @@ from .base import BaseProvider
def _value_keyer(v):
return '{}-{}-{}'.format(v.get('type', ''), v['name'], v.get('data', ''))
return (v.get('type', ''), v['name'], v.get('data', ''))
def add_trailing_dot(s):

View File

@@ -926,7 +926,7 @@ class MxValue(object):
}
def __hash__(self):
return hash('{} {}'.format(self.preference, self.exchange))
return hash((self.preference, self.exchange))
def __eq__(self, other):
return ((self.preference, self.exchange) ==