Skip to content

Commit

Permalink
Allowed Address pair MAC should not be defaulted to interface MAC
Browse files Browse the repository at this point in the history
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 643e770)
  • Loading branch information
bailkeri committed Mar 24, 2016
1 parent 67ce562 commit 9cabea5
Showing 1 changed file with 0 additions and 13 deletions.
13 changes: 0 additions & 13 deletions src/config/api-server/vnc_cfg_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -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']
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 9cabea5

Please sign in to comment.