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:
@@ -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])
|
||||
|
@@ -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):
|
||||
|
@@ -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) ==
|
||||
|
Reference in New Issue
Block a user