← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1783551] [NEW] _set_config_VIFGeneric should accept os-vif object

 

Public bug reported:

Description
===========

While working on adjacent codepaths exercising
nova.virt.libvirt.vif._set_config_VIFGeneric I discovered that it
appears to expect a Nova VIF object instead of an os-vif object. Since
the _set_config_* functions are called to convert os-vif objects to
libvirt xml config, this trips up. It's not caught in production or
tests because the tests were removed (mistakenly thought to be
dangling). For example, re-introducing a test shows the issue:

 nova.tests.unit.virt.libvirt.test_vif.LibvirtVifTestCase.test_ivs_ethernet_driver
 ---------------------------------------------------------------------------------

 Captured traceback:
 ~~~~~~~~~~~~~~~~~~~
     Traceback (most recent call last):
       File "nova/tests/unit/virt/libvirt/test_vif.py", line 1395, in test_ivs_ethernet_driver
         xml = self._get_instance_xml(d, self.vif_ivs)
       File "nova/tests/unit/virt/libvirt/test_vif.py", line 572, in _get_instance_xml
         hostimpl)
       File "nova/virt/libvirt/vif.py", line 583, in get_config
         vnic_type)
       File "nova/virt/libvirt/vif.py", line 555, in _get_config_os_vif
         func(instance, vif, conf, host)
       File "nova/virt/libvirt/vif.py", line 463, in _set_config_VIFGeneric
         dev = self.get_vif_devname(vif)
       File "nova/virt/libvirt/vif.py", line 108, in get_vif_devname
         return ("nic" + vif['id'])[:network_model.NIC_NAME_LEN]
     TypeError: 'VIFGeneric' object has no attribute '__getitem__'

This happened in https://review.openstack.org/#/c/534371/ during the
Rocky cycle, so it's likely that the impact was not experienced
externally (or tested much).

Steps to Reproduce
==================

It's likely to hit practice if the third-party IVS os-vif plugin
exercises this codepath. Other than that, the way to reproduce this
would be to add back the tests.

** Affects: nova
     Importance: Undecided
     Assignee: Jan Gutter (jangutter)
         Status: In Progress

-- 
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to OpenStack Compute (nova).
https://bugs.launchpad.net/bugs/1783551

Title:
  _set_config_VIFGeneric should accept os-vif object

Status in OpenStack Compute (nova):
  In Progress

Bug description:
  Description
  ===========

  While working on adjacent codepaths exercising
  nova.virt.libvirt.vif._set_config_VIFGeneric I discovered that it
  appears to expect a Nova VIF object instead of an os-vif object. Since
  the _set_config_* functions are called to convert os-vif objects to
  libvirt xml config, this trips up. It's not caught in production or
  tests because the tests were removed (mistakenly thought to be
  dangling). For example, re-introducing a test shows the issue:

   nova.tests.unit.virt.libvirt.test_vif.LibvirtVifTestCase.test_ivs_ethernet_driver
   ---------------------------------------------------------------------------------

   Captured traceback:
   ~~~~~~~~~~~~~~~~~~~
       Traceback (most recent call last):
         File "nova/tests/unit/virt/libvirt/test_vif.py", line 1395, in test_ivs_ethernet_driver
           xml = self._get_instance_xml(d, self.vif_ivs)
         File "nova/tests/unit/virt/libvirt/test_vif.py", line 572, in _get_instance_xml
           hostimpl)
         File "nova/virt/libvirt/vif.py", line 583, in get_config
           vnic_type)
         File "nova/virt/libvirt/vif.py", line 555, in _get_config_os_vif
           func(instance, vif, conf, host)
         File "nova/virt/libvirt/vif.py", line 463, in _set_config_VIFGeneric
           dev = self.get_vif_devname(vif)
         File "nova/virt/libvirt/vif.py", line 108, in get_vif_devname
           return ("nic" + vif['id'])[:network_model.NIC_NAME_LEN]
       TypeError: 'VIFGeneric' object has no attribute '__getitem__'

  This happened in https://review.openstack.org/#/c/534371/ during the
  Rocky cycle, so it's likely that the impact was not experienced
  externally (or tested much).

  Steps to Reproduce
  ==================

  It's likely to hit practice if the third-party IVS os-vif plugin
  exercises this codepath. Other than that, the way to reproduce this
  would be to add back the tests.

To manage notifications about this bug go to:
https://bugs.launchpad.net/nova/+bug/1783551/+subscriptions


Follow ups