From 0a4f5ad64ddd1bb22d1ecb70bf0c48704e4442e1 Mon Sep 17 00:00:00 2001 From: kevgliss Date: Sun, 10 Jan 2016 17:22:50 -0800 Subject: [PATCH] Fixing an assumption that 'subAltNames' are always passed to the API. --- lemur/certificates/views.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/lemur/certificates/views.py b/lemur/certificates/views.py index 4436b0b2..009d1c16 100644 --- a/lemur/certificates/views.py +++ b/lemur/certificates/views.py @@ -78,9 +78,11 @@ def get_domains_from_options(options): :return: """ domains = [options['commonName']] - for k, v in options['extensions']['subAltNames']['names']: - if k == 'DNSName': - domains.append(v) + if options.get('extensions'): + if options['extensions'].get('subAltNames'): + for k, v in options['extensions']['subAltNames']['names']: + if k == 'DNSName': + domains.append(v) return domains