Avoid KeyError when accessing "dns_name" as it may not exist
Neutron LBaaS does not pass a full copy of the request_data into this function, and causes the port create to fail with a KeyError Change-Id: Ib81cbbaf24a4ffaa983e1b05146aea0dc74e29bb Fixes-Bug: #1605336
This commit is contained in:
@@ -76,7 +76,7 @@ class DNSExtensionDriver(api.ExtensionDriver):
|
||||
db_data[dns.DNSDOMAIN] = new_value
|
||||
|
||||
def process_create_port(self, plugin_context, request_data, db_data):
|
||||
if not request_data[dns.DNSNAME]:
|
||||
if not request_data.get(dns.DNSNAME):
|
||||
return
|
||||
dns_name, is_dns_domain_default = self._get_request_dns_name(
|
||||
request_data)
|
||||
|
||||
Reference in New Issue
Block a user