diff --git a/openstackclient/tests/image/v1/fakes.py b/openstackclient/tests/image/v1/fakes.py index 972e641589..e49231d743 100644 --- a/openstackclient/tests/image/v1/fakes.py +++ b/openstackclient/tests/image/v1/fakes.py @@ -17,7 +17,7 @@ from openstackclient.tests import fakes from openstackclient.tests import utils -from openstackclient.tests.volume.v1 import fakes as volume_fakes +from openstackclient.tests.volume.v2 import fakes as volume_fakes image_id = 'im1' @@ -66,7 +66,7 @@ def setUp(self): endpoint=fakes.AUTH_URL, token=fakes.AUTH_TOKEN, ) - self.app.client_manager.volume = volume_fakes.FakeVolumev1Client( + self.app.client_manager.volume = volume_fakes.FakeVolumev2Client( endpoint=fakes.AUTH_URL, token=fakes.AUTH_TOKEN, ) diff --git a/openstackclient/tests/volume/test_find_resource.py b/openstackclient/tests/volume/test_find_resource.py index 56081966b7..10c3b623ce 100644 --- a/openstackclient/tests/volume/test_find_resource.py +++ b/openstackclient/tests/volume/test_find_resource.py @@ -15,8 +15,8 @@ import mock -from cinderclient.v1 import volume_snapshots -from cinderclient.v1 import volumes +from cinderclient.v2 import volume_snapshots +from cinderclient.v2 import volumes from openstackclient.common import exceptions from openstackclient.common import utils diff --git a/openstackclient/tests/volume/v1/__init__.py b/openstackclient/tests/volume/v2/__init__.py similarity index 100% rename from openstackclient/tests/volume/v1/__init__.py rename to openstackclient/tests/volume/v2/__init__.py diff --git a/openstackclient/tests/volume/v1/fakes.py b/openstackclient/tests/volume/v2/fakes.py similarity index 94% rename from openstackclient/tests/volume/v1/fakes.py rename to openstackclient/tests/volume/v2/fakes.py index 3477819072..cc9074f5c7 100644 --- a/openstackclient/tests/volume/v1/fakes.py +++ b/openstackclient/tests/volume/v2/fakes.py @@ -84,7 +84,7 @@ def __init__(self, **kwargs): self.images = mock.Mock() -class FakeVolumev1Client(object): +class FakeVolumev2Client(object): def __init__(self, **kwargs): self.volumes = mock.Mock() self.volumes.resource_class = fakes.FakeResource(None, {}) @@ -96,11 +96,11 @@ def __init__(self, **kwargs): self.management_url = kwargs['endpoint'] -class TestVolumev1(utils.TestCommand): +class TestVolumev2(utils.TestCommand): def setUp(self): - super(TestVolumev1, self).setUp() + super(TestVolumev2, self).setUp() - self.app.client_manager.volume = FakeVolumev1Client( + self.app.client_manager.volume = FakeVolumev2Client( endpoint=fakes.AUTH_URL, token=fakes.AUTH_TOKEN, ) diff --git a/openstackclient/tests/volume/v1/test_volume.py b/openstackclient/tests/volume/v2/test_volume.py similarity index 99% rename from openstackclient/tests/volume/v1/test_volume.py rename to openstackclient/tests/volume/v2/test_volume.py index cc5aeff80b..f1d003c1d1 100644 --- a/openstackclient/tests/volume/v1/test_volume.py +++ b/openstackclient/tests/volume/v2/test_volume.py @@ -17,11 +17,11 @@ from openstackclient.tests import fakes from openstackclient.tests.identity.v2_0 import fakes as identity_fakes -from openstackclient.tests.volume.v1 import fakes as volume_fakes -from openstackclient.volume.v1 import volume +from openstackclient.tests.volume.v2 import fakes as volume_fakes +from openstackclient.volume.v2 import volume -class TestVolume(volume_fakes.TestVolumev1): +class TestVolume(volume_fakes.TestVolumev2): def setUp(self): super(TestVolume, self).setUp() diff --git a/openstackclient/volume/client.py b/openstackclient/volume/client.py index f4e2decb35..659045ab5a 100644 --- a/openstackclient/volume/client.py +++ b/openstackclient/volume/client.py @@ -16,13 +16,13 @@ import logging from cinderclient import extension -from cinderclient.v1.contrib import list_extensions -from cinderclient.v1 import volume_snapshots -from cinderclient.v1 import volumes +from cinderclient.v2.contrib import list_extensions +from cinderclient.v2 import volume_snapshots +from cinderclient.v2 import volumes from openstackclient.common import utils -# Monkey patch for v1 cinderclient +# Monkey patch for v2 cinderclient volumes.Volume.NAME_ATTR = 'display_name' volume_snapshots.Snapshot.NAME_ATTR = 'display_name' @@ -32,7 +32,7 @@ API_VERSION_OPTION = 'os_volume_api_version' API_NAME = "volume" API_VERSIONS = { - "1": "cinderclient.v1.client.Client" + "2": "cinderclient.v2.client.Client" } diff --git a/openstackclient/volume/v1/__init__.py b/openstackclient/volume/v2/__init__.py similarity index 100% rename from openstackclient/volume/v1/__init__.py rename to openstackclient/volume/v2/__init__.py diff --git a/openstackclient/volume/v1/backup.py b/openstackclient/volume/v2/backup.py similarity index 99% rename from openstackclient/volume/v1/backup.py rename to openstackclient/volume/v2/backup.py index 8c16ba256f..dcc3bdbce7 100644 --- a/openstackclient/volume/v1/backup.py +++ b/openstackclient/volume/v2/backup.py @@ -13,7 +13,7 @@ # under the License. # -"""Volume v1 Backup action implementations""" +"""Volume v2 Backup action implementations""" import logging import six diff --git a/openstackclient/volume/v1/snapshot.py b/openstackclient/volume/v2/snapshot.py similarity index 99% rename from openstackclient/volume/v1/snapshot.py rename to openstackclient/volume/v2/snapshot.py index c9e1baca92..4fa9792949 100644 --- a/openstackclient/volume/v1/snapshot.py +++ b/openstackclient/volume/v2/snapshot.py @@ -13,7 +13,7 @@ # under the License. # -"""Volume v1 Snapshot action implementations""" +"""Volume v2 Snapshot action implementations""" import logging import six diff --git a/openstackclient/volume/v1/type.py b/openstackclient/volume/v2/type.py similarity index 99% rename from openstackclient/volume/v1/type.py rename to openstackclient/volume/v2/type.py index 71bfc9eaba..c58cb46095 100644 --- a/openstackclient/volume/v1/type.py +++ b/openstackclient/volume/v2/type.py @@ -13,7 +13,7 @@ # under the License. # -"""Volume v1 Type action implementations""" +"""Volume v2 Type action implementations""" import logging import six diff --git a/openstackclient/volume/v1/volume.py b/openstackclient/volume/v2/volume.py similarity index 99% rename from openstackclient/volume/v1/volume.py rename to openstackclient/volume/v2/volume.py index d82f6b4b76..0596fe9b7b 100644 --- a/openstackclient/volume/v1/volume.py +++ b/openstackclient/volume/v2/volume.py @@ -13,7 +13,7 @@ # under the License. # -"""Volume v1 Volume action implementations""" +"""Volume v2 Volume action implementations""" import logging import six