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

Handle MX preference of 0

This commit is contained in:
Ross McFarland
2018-01-21 06:31:37 -08:00
parent 52d4aa1af8
commit af435c3130
2 changed files with 5 additions and 2 deletions

View File

@@ -506,7 +506,10 @@ class MxValue(object):
def _validate_value(cls, value):
reasons = []
try:
int(value.get('preference', None) or value['priority'])
try:
int(value['preference'])
except KeyError:
int(value['priority'])
except KeyError:
reasons.append('missing preference')
except ValueError:

View File

@@ -345,7 +345,7 @@ class TestRecord(TestCase):
self.assertEquals(a_data, a.data)
b_value = {
'preference': 12,
'preference': 0,
'exchange': 'smtp3.',
}
b_data = {'ttl': 30, 'value': b_value}