Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix for device_id exception raised when creating Neutron network port in HPB #931

Merged
merged 1 commit into from
Jun 5, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions f5lbaasdriver/v2/bigip/plugin_rpc.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
# limitations under the License.
#

import uuid

from oslo_log import helpers as log_helpers
from oslo_log import log as logging

Expand Down Expand Up @@ -536,6 +538,9 @@ def create_port_on_subnet(self, context, subnet_id=None,

if device_id:
port_data['device_id'] = device_id
else:
port_data['device_id'] = str(uuid.uuid5(
uuid.NAMESPACE_DNS, str(host)))
port_data[portbindings.HOST_ID] = host
port_data[portbindings.VNIC_TYPE] = vnic_type
port_data[portbindings.PROFILE] = binding_profile
Expand Down Expand Up @@ -700,6 +705,9 @@ def create_port_on_network(self, context, network_id=None,
}
if device_id:
port_data['device_id'] = device_id
else:
port_data['device_id'] = str(uuid.uuid5(
uuid.NAMESPACE_DNS, str(host)))
port_data[portbindings.HOST_ID] = host
port_data[portbindings.VNIC_TYPE] = vnic_type
port_data[portbindings.PROFILE] = binding_profile
Expand Down