Merge "os-vif-util: set vif_name for vhostuser ovs os-vif port"

This commit is contained in:
Jenkins
2017-01-20 20:47:05 +00:00
committed by Gerrit Code Review
2 changed files with 4 additions and 1 deletions

View File

@@ -284,8 +284,10 @@ def _nova_to_osvif_vif_vhostuser(vif):
if vif['details'].get(model.VIF_DETAILS_VHOSTUSER_OVS_PLUG, False):
profile = objects.vif.VIFPortProfileOpenVSwitch(
interface_id=vif.get('ovs_interfaceid') or vif['id'])
vif_name = ('vhu' + vif['id'])[:model.NIC_NAME_LEN]
obj = _get_vif_instance(vif, objects.vif.VIFVHostUser,
port_profile=profile, plugin="ovs")
port_profile=profile, plugin="ovs",
vif_name=vif_name)
if vif["network"]["bridge"] is not None:
obj.bridge_name = vif["network"]["bridge"]
obj.mode = vif['details'].get(

View File

@@ -572,6 +572,7 @@ class OSVIFUtilTestCase(test.NoDBTestCase):
plugin="ovs",
port_profile=osv_objects.vif.VIFPortProfileOpenVSwitch(
interface_id="dc065497-3c8d-4f44-8fb4-e1d33c16a536"),
vif_name="vhudc065497-3c",
path='/fake/socket',
mode='client',
has_traffic_filtering=True,