Browse Source

Merge pull request #173 from github/handle-0-pref

Handle MX preference of 0
pull/185/head
Ross McFarland 8 years ago
committed by GitHub
parent
commit
4946837faf
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 2 deletions
  1. +4
    -1
      octodns/record.py
  2. +1
    -1
      tests/test_octodns_record.py

+ 4
- 1
octodns/record.py 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:


+ 1
- 1
tests/test_octodns_record.py 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}


Loading…
Cancel
Save