Skip to content

Commit

Permalink
Merge "Handle KeyError if aap json data is missing mac field" into R3.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Zuul authored and opencontrail-ci-admin committed Feb 25, 2016
2 parents f97ea9f + fdf14fa commit 241c8b1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/config/api-server/vnc_cfg_types.py
Expand Up @@ -462,7 +462,7 @@ def pre_dbe_create(cls, tenant_name, obj_dict, db_conn):
aap_config = obj_dict.get(
'virtual_machine_interface_allowed_address_pairs', {})
for aap in aap_config.get('allowed_address_pair', []):
if aap['mac'] == "":
if not aap.get('mac', None):
aap['mac'] = mac_addrs_dict['mac_address'][0]

if 'virtual_machine_interface_bindings' in obj_dict:
Expand Down Expand Up @@ -548,7 +548,7 @@ def pre_dbe_update(cls, id, fq_name, obj_dict, db_conn,
aap_config = obj_dict.get(
'virtual_machine_interface_allowed_address_pairs', {})
for aap in aap_config.get('allowed_address_pair', []):
if aap['mac'] == "":
if not aap.get('mac', None):
aap['mac'] = read_result[
'virtual_machine_interface_mac_addresses']['mac_address'][0]

Expand Down

0 comments on commit 241c8b1

Please sign in to comment.