From 9cabea554750156c8d7d17d8a2172fe75ee78016 Mon Sep 17 00:00:00 2001 From: Prakash Bailkeri Date: Thu, 24 Mar 2016 10:46:01 +0530 Subject: [PATCH] Allowed Address pair MAC should not be defaulted to interface MAC Currently, if the allowed address field in json request doesn't not contain MAC or set to NULL, it is defaulted to port mac address. Idea is to skip resetting in config and handle the case where MAC is missing in vrouter-agent. Change-Id: I38ee7bab486fa720640bf3678fdfda4603a90f73 Closes-bug: #1549339 (cherry picked from commit 643e7706677d338dd1d6b4724c8a2ba0f58580c8) --- src/config/api-server/vnc_cfg_types.py | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/src/config/api-server/vnc_cfg_types.py b/src/config/api-server/vnc_cfg_types.py index 354c146d174..0bba0beeef0 100644 --- a/src/config/api-server/vnc_cfg_types.py +++ b/src/config/api-server/vnc_cfg_types.py @@ -554,12 +554,6 @@ def pre_dbe_create(cls, tenant_name, obj_dict, db_conn): mac_addrs_dict = json.loads(mac_addrs_json) obj_dict['virtual_machine_interface_mac_addresses'] = mac_addrs_dict - aap_config = obj_dict.get( - 'virtual_machine_interface_allowed_address_pairs', {}) - for aap in aap_config.get('allowed_address_pair', []): - if not aap.get('mac', None): - aap['mac'] = mac_addrs_dict['mac_address'][0] - if 'virtual_machine_interface_bindings' in obj_dict: bindings = obj_dict['virtual_machine_interface_bindings'] kvps = bindings['key_value_pair'] @@ -643,13 +637,6 @@ def pre_dbe_update(cls, id, fq_name, obj_dict, db_conn, msg = "VMI ref delete not allowed during update" return (False, (409, msg)) - aap_config = obj_dict.get( - 'virtual_machine_interface_allowed_address_pairs', {}) - for aap in aap_config.get('allowed_address_pair', []): - if not aap.get('mac', None): - aap['mac'] = read_result[ - 'virtual_machine_interface_mac_addresses']['mac_address'][0] - bindings = read_result.get('virtual_machine_interface_bindings', {}) kvps = bindings.get('key_value_pair', []) kvp_dict = cls._kvp_to_dict(kvps)