Check description before using it in update_zone()
... so that we don't throw a KeyError because the description key is not in the dictionary. Closes-Bug: #2120952 Change-Id: Id690070d282ba765eacfdcac8cdee30dd32d544d Signed-off-by: Tobias Urdin <tobias.urdin@binero.com>
This commit is contained in:
@@ -64,9 +64,10 @@ def update_zone(request, **kwargs):
|
||||
conn = get_sdk_connection(request)
|
||||
build_kwargs = dict(
|
||||
email=data['email'],
|
||||
description=data['description'],
|
||||
ttl=data['ttl'],
|
||||
)
|
||||
if data.get('description', None):
|
||||
build_kwargs['description'] = data['description']
|
||||
zone = conn.dns.update_zone(
|
||||
zone_id, **build_kwargs)
|
||||
return zone.to_dict()
|
||||
|
Reference in New Issue
Block a user