From 36b4a421c9133523cb5a4d3d1183e1e46e2ce395 Mon Sep 17 00:00:00 2001 From: Ross McFarland Date: Mon, 10 Dec 2018 08:24:41 -0800 Subject: [PATCH] Simplify values -> value -> [] fallback code in _ValuesMixin --- octodns/record.py | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/octodns/record.py b/octodns/record.py index 4e434e3..3a7d552 100644 --- a/octodns/record.py +++ b/octodns/record.py @@ -254,13 +254,7 @@ class _ValuesMixin(object): def validate(cls, name, data): reasons = super(_ValuesMixin, cls).validate(name, data) - try: - values = data['values'] - except KeyError: - try: - values = data['value'] - except KeyError: - values = [] + values = data.get('values', data.get('value', [])) reasons.extend(cls._value_type.validate(values, cls._type))