summaryrefslogtreecommitdiff
path: root/tests/unittests/test_ec2_util.py
diff options
context:
space:
mode:
authorScott Moser <smoser@brickies.net>2017-03-31 10:56:04 -0400
committerScott Moser <smoser@brickies.net>2017-03-31 16:29:49 -0400
commitbf7723e8092bb1f8a442aa2399dd870e130a27d9 (patch)
tree8c34a975248b7cc509f33202ccbda36da508438f /tests/unittests/test_ec2_util.py
parent5442b517ebe5508159a46d11d500fbc6ad854ba0 (diff)
downloadvyos-cloud-init-bf7723e8092bb1f8a442aa2399dd870e130a27d9.tar.gz
vyos-cloud-init-bf7723e8092bb1f8a442aa2399dd870e130a27d9.zip
Fix bug that resulted in an attempt to rename bonds or vlans.
When cloud-init ran in the init stage (after networking had come up). A bug could occur where cloud-init would attempt and fail to rename network devices that had "inherited" mac addresses. The intent of apply_network_config_names was always to rename only the devices that were "physical" per the network config. (This would include veth devices in a container). The bug was in creating the dictionary of interfaces by mac address. If there were multiple interfaces with the same mac address then renames could fail. This situation was guaranteed to occur with bonds or vlans or other devices that inherit their mac. The solution is to change get_interfaces_by_mac to skip interfaces that have an inherited mac. Also drop the 'devs' argument to get_interfaces_by_mac. It was non-obvious what the result should be if a device in the input list was filtered out. ie should the following have an entry for bond0 or not. get_interfaces_by_mac(devs=['bond0']) LP: #1669860
Diffstat (limited to 'tests/unittests/test_ec2_util.py')
0 files changed, 0 insertions, 0 deletions