Use Block Storage API v3 instead of API v2
Block Storage API v2 was deprecated during Pike cycle and is being removed during Xena cycle, and current v3 API should be used instead. Change-Id: Ia5247742b31f5f07186ef908588f0972d3ac609f
This commit is contained in:
@@ -17,7 +17,7 @@ import time
|
||||
from oslo_log import log
|
||||
|
||||
from cinderclient import exceptions as cinder_exception
|
||||
from cinderclient.v2.volumes import Volume
|
||||
from cinderclient.v3.volumes import Volume
|
||||
from watcher._i18n import _
|
||||
from watcher.common import clients
|
||||
from watcher.common import exception
|
||||
|
||||
@@ -205,7 +205,7 @@ class CinderModelBuilder(base.BaseModelBuilder):
|
||||
"""Build a storage node from a Cinder storage node
|
||||
|
||||
:param node: A storage node
|
||||
:type node: :py:class:`~cinderclient.v2.services.Service`
|
||||
:type node: :py:class:`~cinderclient.v3.services.Service`
|
||||
"""
|
||||
# node.host is formatted as host@backendname since ocata,
|
||||
# or may be only host as of ocata
|
||||
@@ -233,7 +233,7 @@ class CinderModelBuilder(base.BaseModelBuilder):
|
||||
"""Build a storage pool from a Cinder storage pool
|
||||
|
||||
:param pool: A storage pool
|
||||
:type pool: :py:class:`~cinderclient.v2.pools.Pool`
|
||||
:type pool: :py:class:`~cinderclient.v3.pools.Pool`
|
||||
:raises: exception.InvalidPoolAttributeValue
|
||||
"""
|
||||
# build up the storage pool.
|
||||
|
||||
@@ -16,7 +16,7 @@ from dateutil.parser import parse
|
||||
|
||||
from oslo_log import log
|
||||
|
||||
from cinderclient.v2.volumes import Volume
|
||||
from cinderclient.v3.volumes import Volume
|
||||
from novaclient.v2.servers import Server
|
||||
from watcher._i18n import _
|
||||
from watcher.common import cinder_helper
|
||||
|
||||
@@ -144,7 +144,7 @@ class TestZoneMigration(TestBaseStrategy):
|
||||
|
||||
@staticmethod
|
||||
def fake_volume(**kwargs):
|
||||
volume = mock.MagicMock(spec=cinderclient.v2.volumes.Volume)
|
||||
volume = mock.MagicMock(spec=cinderclient.v3.volumes.Volume)
|
||||
volume.id = kwargs.get('id', utils.generate_uuid())
|
||||
volume.name = kwargs.get('name', 'fake_name')
|
||||
volume.status = kwargs.get('status', 'available')
|
||||
|
||||
Reference in New Issue
Block a user