Fix bug in "nova/tests/unit/virt/test_virt_drivers.py" for os-vif

Commit 735f710 moved the os_vif.initialize() code. This lead to an
error in "test_virt_drivers.LibvirtConnTestCase.test_set_admin_password":

  AttributeError: 'module' object has no attribute 'vif

This change initializes os_vif in "test_virt_driver" as it was done
for "libvirt.test_driver" in commit 735f710.

Change-Id: Idf2fcb1df92dd4aa1761d955ea149090263d42d8
Closes-Bug: #1632987
This commit is contained in:
Markus Zoeller 2016-10-13 10:24:23 +02:00
parent bc1b11fdc2
commit f022d57548
1 changed files with 2 additions and 0 deletions

View File

@ -20,6 +20,7 @@ import traceback
import fixtures
import mock
import netaddr
import os_vif
from oslo_log import log as logging
from oslo_serialization import jsonutils
from oslo_utils import importutils
@ -250,6 +251,7 @@ class _VirtDriverTestCase(_FakeDriverBackendTestCase):
# here; we test it in test_imagebackend.py
self.stubs.Set(imagebackend.Image, 'resolve_driver_format',
imagebackend.Image._get_driver_format)
os_vif.initialize()
def _get_running_instance(self, obj=True):
instance_ref = test_utils.get_test_instance(obj=obj)