diff --git a/octodns/record/__init__.py b/octodns/record/__init__.py index ba0ab98..bb7a6f8 100644 --- a/octodns/record/__init__.py +++ b/octodns/record/__init__.py @@ -852,7 +852,7 @@ class MxValue(object): exchange = value['exchange'] except KeyError: exchange = value['value'] - self.exchange = exchange + self.exchange = exchange.lower() @property def data(self): diff --git a/tests/test_octodns_record.py b/tests/test_octodns_record.py index 4f05126..4171e80 100644 --- a/tests/test_octodns_record.py +++ b/tests/test_octodns_record.py @@ -354,6 +354,17 @@ class TestRecord(TestCase): self.assertEquals(b_value['exchange'], b.values[0].exchange) self.assertEquals(b_data, b.data) + a_upper_values = [{ + 'preference': 10, + 'exchange': 'SMTP1.' + }, { + 'priority': 20, + 'value': 'SMTP2.' + }] + a_upper_data = {'ttl': 30, 'values': a_upper_values} + a_upper = MxRecord(self.zone, 'a', a_upper_data) + self.assertEquals(a_upper.data, a.data) + target = SimpleProvider() # No changes with self self.assertFalse(a.changes(a, target))