Passing port's project_id in port_bind

Only get port's tenant_id if we're in Keystone v2.

Closes-Bug: #1649218
Change-Id: I7cf64183785f9eb04d9f831ec3cc65c2f9ee01f8
This commit is contained in:
Dongcan Ye 2016-12-12 15:55:35 +08:00 committed by Dongcan Ye
parent bd84c9f281
commit 0cd6cfa02f
1 changed files with 1 additions and 1 deletions

View File

@ -73,7 +73,7 @@ def port_bind(endpoint_id, port, subnets, network=None, vm_port=None,
try:
stdout, stderr = _configure_host_iface(
host_ifname, endpoint_id, port_id,
port['network_id'], port['tenant_id'],
port['network_id'], port.get('project_id') or port['tenant_id'],
port[utils.MAC_ADDRESS_KEY],
kind=port.get(constants.VIF_TYPE_KEY),
details=port.get(constants.VIF_DETAILS_KEY))