Fix code for U-Release
These changes are required to keep nova-powervm code in sync with the changes happening in rest of the community for U release. Change-Id: I13d8ead2c411973bc280f64bbb94d9115e3ce294
This commit is contained in:
parent
376d9493e2
commit
e9a1e5293c
|
@ -111,7 +111,7 @@ class TestLocalDisk(test.NoDBTestCase):
|
|||
self.assertEqual(3, mock_sleep.call_count)
|
||||
|
||||
@mock.patch('pypowervm.tasks.storage.upload_new_vdisk', autospec=True)
|
||||
@mock.patch('nova.image.api.API.download')
|
||||
@mock.patch('nova.image.glance.API.download')
|
||||
@mock.patch('nova_powervm.virt.powervm.disk.driver.IterableToFileAdapter')
|
||||
@mock.patch('nova_powervm.virt.powervm.disk.localdisk.LocalStorage.'
|
||||
'_get_vg_wrap')
|
||||
|
|
|
@ -273,7 +273,7 @@ class TestSSPDiskAdapter(test.NoDBTestCase):
|
|||
@mock.patch('nova_powervm.virt.powervm.disk.driver.DiskAdapter.'
|
||||
'_get_disk_name')
|
||||
@mock.patch('pypowervm.tasks.storage.crt_lu')
|
||||
@mock.patch('nova.image.api.API.download')
|
||||
@mock.patch('nova.image.glance.API.download')
|
||||
@mock.patch('nova_powervm.virt.powervm.disk.driver.IterableToFileAdapter')
|
||||
def test_create_disk_from_image(self, mock_it2f, mock_dl, mock_crt_lu,
|
||||
mock_gdn, mock_vuuid, mock_gin, mock_goru):
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
# Copyright 2015, 2017 IBM Corp.
|
||||
# Copyright 2015, 2020 IBM Corp.
|
||||
#
|
||||
# All Rights Reserved.
|
||||
#
|
||||
|
@ -34,7 +34,8 @@ class ImageAPI(fixtures.Fixture):
|
|||
|
||||
def setUp(self):
|
||||
super(ImageAPI, self).setUp()
|
||||
self.img_api_fx = self.useFixture(fixtures.MockPatch('nova.image.API'))
|
||||
self.img_api_fx = self.useFixture(
|
||||
fixtures.MockPatch('nova.image.glance.API'))
|
||||
|
||||
|
||||
class DiskAdapter(fixtures.Fixture):
|
||||
|
|
|
@ -31,7 +31,7 @@ class TestImage(test.NoDBTestCase):
|
|||
|
||||
@mock.patch('nova.utils.temporary_chown', autospec=True)
|
||||
@mock.patch(_BUILTIN + '.open', autospec=True)
|
||||
@mock.patch('nova.image.api.API', autospec=True)
|
||||
@mock.patch('nova.image.glance.API', autospec=True)
|
||||
def test_stream_blockdev_to_glance(self, mock_api, mock_open, mock_chown):
|
||||
mock_open.return_value.__enter__.return_value = 'mock_stream'
|
||||
image.stream_blockdev_to_glance('context', mock_api, 'image_id',
|
||||
|
@ -41,7 +41,7 @@ class TestImage(test.NoDBTestCase):
|
|||
mock_api.update.assert_called_with('context', 'image_id', 'metadata',
|
||||
'mock_stream')
|
||||
|
||||
@mock.patch('nova.image.api.API', autospec=True)
|
||||
@mock.patch('nova.image.glance.API', autospec=True)
|
||||
def test_generate_snapshot_metadata(self, mock_api):
|
||||
mock_api.get.return_value = {'name': 'image_name'}
|
||||
mock_instance = mock.Mock()
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
# Copyright 2016, 2018 IBM Corp.
|
||||
# Copyright 2016, 2020 IBM Corp.
|
||||
#
|
||||
# All Rights Reserved.
|
||||
#
|
||||
|
@ -18,7 +18,7 @@ import mock
|
|||
|
||||
from nova import exception
|
||||
from nova.network import model
|
||||
from nova.network.neutronv2 import api as netapi
|
||||
from nova.network import neutron as netapi
|
||||
from nova import test
|
||||
from oslo_config import cfg
|
||||
from pypowervm import exceptions as pvm_ex
|
||||
|
|
|
@ -20,7 +20,7 @@ from oslo_log import log as logging
|
|||
from oslo_utils import excutils
|
||||
|
||||
from nova import exception as nova_exc
|
||||
from nova import image
|
||||
from nova.image import glance
|
||||
|
||||
from pypowervm import const as pvm_const
|
||||
from pypowervm import exceptions as pvm_exc
|
||||
|
@ -40,7 +40,7 @@ from nova_powervm.virt.powervm import vm
|
|||
|
||||
LOG = logging.getLogger(__name__)
|
||||
CONF = cfg.CONF
|
||||
IMAGE_API = image.API()
|
||||
IMAGE_API = glance.API()
|
||||
|
||||
|
||||
class LocalStorage(disk_dvr.DiskAdapter):
|
||||
|
|
|
@ -23,7 +23,7 @@ from nova_powervm.virt.powervm import exception as npvmex
|
|||
from nova_powervm.virt.powervm.i18n import _
|
||||
from nova_powervm.virt.powervm import vm
|
||||
|
||||
from nova import image
|
||||
from nova.image import glance
|
||||
from oslo_utils import excutils
|
||||
import pypowervm.const as pvm_const
|
||||
from pypowervm.tasks import cluster_ssp as tsk_cs
|
||||
|
@ -37,7 +37,7 @@ import pypowervm.wrappers.storage as pvm_stg
|
|||
|
||||
LOG = logging.getLogger(__name__)
|
||||
CONF = cfg.CONF
|
||||
IMAGE_API = image.API()
|
||||
IMAGE_API = glance.API()
|
||||
|
||||
|
||||
class SSPDiskAdapter(disk_drv.DiskAdapter):
|
||||
|
|
|
@ -21,7 +21,7 @@ from nova.compute import vm_states
|
|||
from nova.console import type as console_type
|
||||
from nova import context as ctx
|
||||
from nova import exception
|
||||
from nova import image
|
||||
from nova.image import glance
|
||||
from nova import objects
|
||||
from nova import utils as n_utils
|
||||
from nova.virt import configdrive
|
||||
|
@ -144,7 +144,7 @@ class PowerVMDriver(driver.ComputeDriver):
|
|||
|
||||
# Initialize the disk adapter. Sets self.disk_dvr
|
||||
self._setup_disk_adapter()
|
||||
self.image_api = image.API()
|
||||
self.image_api = glance.API()
|
||||
|
||||
self._setup_rebuild_store()
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
# Copyright 2016, 2018 IBM Corp.
|
||||
# Copyright 2016, 2020 IBM Corp.
|
||||
#
|
||||
# All Rights Reserved.
|
||||
#
|
||||
|
@ -19,8 +19,8 @@ import six
|
|||
|
||||
from nova import context as ctx
|
||||
from nova import exception
|
||||
from nova import network as net_api
|
||||
from nova.network import model as network_model
|
||||
from nova.network import neutron as net_api
|
||||
from oslo_config import cfg
|
||||
from oslo_log import log
|
||||
from oslo_serialization import jsonutils
|
||||
|
|
|
@ -1,7 +1,9 @@
|
|||
# The order of packages is significant, because pip processes them in the order
|
||||
# of appearance. Changing the order has an impact on the overall integration
|
||||
# process, which may cause wedges in the gate later.
|
||||
hacking>=1.1.0,<1.2.0 # Apache-2.0
|
||||
|
||||
# Do not add hacking, this comes from nova
|
||||
# hacking>=1.1.0,<1.2.0 # Apache-2.0
|
||||
bashate>=0.5.1 # Apache-2.0
|
||||
coverage!=4.4,>=4.0 # Apache-2.0
|
||||
fixtures>=3.0.0 # Apache-2.0/BSD
|
||||
|
|
Loading…
Reference in New Issue