neutron: handle binding:profile=None during migration
The port binding:profile handling in _setup_migration_port_profile
and _update_port_binding_for_instance is not handling when the
binding:profile is set on the port but the value is None, which
results in a NoneType error. Neutron API does not define a format
for this field, or whether or not it will be specified on the port,
and if so, if it's an empty dict or None, so let's be safe and
make sure we handle None.
Because of how many places we access the binding:profile on
a port, this adds a common helper utility.
Co-Authored-By: Eric M Gonzalez <email address hidden>
NOTE(mriedem): Conflicts are caused by not having change
a67af1f110f160861f5cbbff987766c46d60198a and change
ecc8de8d6cccb06d7f4c8ecc144d37612ae1e9cc in Newton.
Change-Id: I564bac88fad6cc47ccbf7425b1ab39899fdc1c2e
Closes-Bug: #1717365
(cherry picked from commit 8ac7be36bedaf0dd3467efc5b5bffdb365b8231b)
(cherry picked from commit c393e490751416f408432ec20e2b1afc1af88af0)
(cherry picked from commit b2577207203167d7b8610531bedf0f480a9b7865)
Reviewed: https:/ /review. openstack. org/506323 /git.openstack. org/cgit/ openstack/ nova/commit/ ?id=2d76ed6e8a9 8f995e3693450cc 788e70080691d5
Committed: https:/
Submitter: Zuul
Branch: stable/newton
commit 2d76ed6e8a98f99 5e3693450cc788e 70080691d5
Author: Matt Riedemann <email address hidden>
Date: Thu Sep 14 18:04:20 2017 -0400
neutron: handle binding: profile= None during migration
The port binding:profile handling in _setup_ migration_ port_profile port_binding_ for_instance is not handling when the
and _update_
binding:profile is set on the port but the value is None, which
results in a NoneType error. Neutron API does not define a format
for this field, or whether or not it will be specified on the port,
and if so, if it's an empty dict or None, so let's be safe and
make sure we handle None.
Because of how many places we access the binding:profile on
a port, this adds a common helper utility.
Co-Authored-By: Eric M Gonzalez <email address hidden>
Conflicts:
nova/ network/ neutronv2/ api.py
nova/ tests/unit/ network/ test_neutronv2. py
NOTE(mriedem): Conflicts are caused by not having change 160861f5cbbff98 7766c46d60198a and change cb06d7f4c8ecc14 4d37612ae1e9cc in Newton.
a67af1f110f
ecc8de8d6cc
Change-Id: I564bac88fad6cc 47ccbf7425b1ab3 9899fdc1c2e d3467efc5b5bffd b365b8231b) 408432ec20e2b1a fc1af88af0) 7b8610531bedf0f 480a9b7865)
Closes-Bug: #1717365
(cherry picked from commit 8ac7be36bedaf0d
(cherry picked from commit c393e490751416f
(cherry picked from commit b2577207203167d