From da1f719c2eaca97e51e69fa1079c1d3b34d54f79 Mon Sep 17 00:00:00 2001 From: Claudiu Belu Date: Thu, 13 Aug 2015 18:34:15 +0300 Subject: [PATCH] Updates requirements.txt and test-requirements.txt Updates vmops and tests to use oslo_utils and oslo_service. Updates test_vhdutils.py as the requirements causes an unit test to fail. Change-Id: Ifaf070c124047cfa8ce38fb1ea10fc930390f9c7 --- hyperv/nova/vmops.py | 4 ++-- hyperv/tests/unit/test_hypervapi.py | 2 +- hyperv/tests/unit/test_vhdutils.py | 9 ++++++++- hyperv/tests/unit/test_vmops.py | 2 +- requirements.txt | 9 +++++---- test-requirements.txt | 6 +++--- 6 files changed, 20 insertions(+), 12 deletions(-) diff --git a/hyperv/nova/vmops.py b/hyperv/nova/vmops.py index 60c88a7d..18f9753a 100644 --- a/hyperv/nova/vmops.py +++ b/hyperv/nova/vmops.py @@ -25,15 +25,15 @@ from eventlet import timeout as etimeout from nova.api.metadata import base as instance_metadata from nova.compute import vm_states from nova import exception -from nova.openstack.common import fileutils -from nova.openstack.common import loopingcall from nova import utils from nova.virt import configdrive from nova.virt import hardware from oslo_concurrency import processutils from oslo_config import cfg from oslo_log import log as logging +from oslo_service import loopingcall from oslo_utils import excutils +from oslo_utils import fileutils from oslo_utils import units from oslo_utils import uuidutils diff --git a/hyperv/tests/unit/test_hypervapi.py b/hyperv/tests/unit/test_hypervapi.py index 705d2ad5..3a5feeb0 100644 --- a/hyperv/tests/unit/test_hypervapi.py +++ b/hyperv/tests/unit/test_hypervapi.py @@ -30,7 +30,6 @@ from nova import exception from nova.image import glance from nova import objects from nova.objects import flavor as flavor_obj -from nova.openstack.common import fileutils from nova.tests.unit import fake_instance from nova.tests.unit import fake_network from nova.tests.unit.image import fake as fake_image @@ -40,6 +39,7 @@ from nova.virt import configdrive from nova.virt import driver from nova.virt import images from oslo_config import cfg +from oslo_utils import fileutils from hyperv.nova import basevolumeutils from hyperv.nova import constants diff --git a/hyperv/tests/unit/test_vhdutils.py b/hyperv/tests/unit/test_vhdutils.py index bb206228..9ab9add2 100644 --- a/hyperv/tests/unit/test_vhdutils.py +++ b/hyperv/tests/unit/test_vhdutils.py @@ -243,10 +243,17 @@ class VHDUtilsTestCase(VHDUtilsBaseTestCase): def test_get_vhd_format_vhd(self): with mock.patch('hyperv.nova.vhdutils.open', - mock.mock_open(read_data=vhdutils.VHD_SIGNATURE), + mock.mock_open(), create=True) as mock_open: f = mock_open.return_value f.tell.return_value = 1024 + readdata = ['notthesig', vhdutils.VHD_SIGNATURE] + + def read(*args): + for content in readdata: + yield content + + f.read.side_effect = read() format = self._vhdutils.get_vhd_format(self._FAKE_VHD_PATH) diff --git a/hyperv/tests/unit/test_vmops.py b/hyperv/tests/unit/test_vmops.py index 55d23a7e..bcc9139c 100644 --- a/hyperv/tests/unit/test_vmops.py +++ b/hyperv/tests/unit/test_vmops.py @@ -19,12 +19,12 @@ import mock from nova.compute import vm_states from nova import exception from nova.objects import flavor as flavor_obj -from nova.openstack.common import fileutils from nova.tests.unit.objects import test_flavor from nova.tests.unit.objects import test_virtual_interface from nova.virt import hardware from oslo_concurrency import processutils from oslo_config import cfg +from oslo_utils import fileutils from oslo_utils import units from hyperv.nova import constants diff --git a/requirements.txt b/requirements.txt index d8061dd6..e746ab05 100644 --- a/requirements.txt +++ b/requirements.txt @@ -2,14 +2,15 @@ # of appearance. Changing the order has an impact on the overall integration # process, which may cause wedges in the gate later. -pbr>=0.6,!=0.7,<1.0 +pbr<2.0,>=1.3 Babel>=1.3 oslo.config>=1.11.0 # Apache-2.0 -oslo.log>=1.2.0 # Apache-2.0 +oslo.log>=1.8.0 # Apache-2.0 oslo.serialization>=1.4.0 # Apache-2.0 -oslo.utils>=1.6.0 # Apache-2.0 +oslo.service>=0.1.0 # Apache-2.0 +oslo.utils>=1.9.0 # Apache-2.0 oslo.i18n>=1.5.0 # Apache-2.0 -eventlet>=0.16.1,!=0.17.0 +eventlet>=0.17.4 -e git+http://github.com/openstack/nova.git#egg=nova diff --git a/test-requirements.txt b/test-requirements.txt index 8592bde2..3a90a756 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -7,9 +7,9 @@ hacking<0.11,>=0.10.0 coverage>=3.6 discover python-subunit>=0.0.18 -sphinx>=1.1.2,!=1.2.0,!=1.3b1,<1.3 +sphinx!=1.2.0,!=1.3b1,<1.3,>=1.1.2 oslosphinx>=2.2.0 # Apache-2.0 -oslotest>=1.2.0 # Apache-2.0 +oslotest>=1.10.0 # Apache-2.0 testrepository>=0.0.18 testscenarios>=0.4 -testtools>=0.9.36,!=1.2.0 +testtools>=1.4.0