From 74048bf974a81d0b85802b6bb1da617ecf07cbe7 Mon Sep 17 00:00:00 2001 From: Ross McFarland Date: Mon, 14 Oct 2019 07:48:47 -0700 Subject: [PATCH] Use if, else rather than try, except KeyError --- octodns/provider/route53.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/octodns/provider/route53.py b/octodns/provider/route53.py index decbd4d..968d8b8 100644 --- a/octodns/provider/route53.py +++ b/octodns/provider/route53.py @@ -564,9 +564,9 @@ def _mod_keyer(mod): if rrset.get('GeoLocation', False): unique_id = rrset['SetIdentifier'] else: - try: + if 'SetIdentifier' in rrset: unique_id = '{}-{}'.format(rrset['Name'], rrset['SetIdentifier']) - except KeyError: + else: unique_id = rrset['Name'] # Prioritise within the action_priority, ensuring targets come first.