From a15924850e46b2cf187ec8cb2b58c170af47a507 Mon Sep 17 00:00:00 2001 From: Arnon Yaari Date: Tue, 3 Jul 2018 15:51:28 +0300 Subject: [PATCH] INFINIDAT: change create_child to create_snapshot create_child method was deprecated in favor of create_snapshot in infinisdk package. This is an internal change and should have no customer impact. Change-Id: I1e89dd2324a6fcd05e2c5336bb0816abf7c5ca2e --- cinder/tests/unit/volume/drivers/test_infinidat.py | 4 ++-- cinder/volume/drivers/infinidat.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/cinder/tests/unit/volume/drivers/test_infinidat.py b/cinder/tests/unit/volume/drivers/test_infinidat.py index 166527f5257..f62960a6709 100644 --- a/cinder/tests/unit/volume/drivers/test_infinidat.py +++ b/cinder/tests/unit/volume/drivers/test_infinidat.py @@ -106,7 +106,7 @@ class InfiniboxDriverTestCaseBase(test.TestCase): self._mock_volume.get_size.return_value = 1 * units.Gi self._mock_volume.has_children.return_value = False self._mock_volume.get_logical_units.return_value = [] - self._mock_volume.create_child.return_value = self._mock_volume + self._mock_volume.create_snapshot.return_value = self._mock_volume self._mock_host = mock.Mock() self._mock_host.get_luns.return_value = [] self._mock_host.map_volume().get_lun.return_value = 1 @@ -340,7 +340,7 @@ class InfiniboxDriverTestCase(InfiniboxDriverTestCaseBase): test_clone, test_snapshot) def test_create_volume_from_snapshot_create_fails(self): - self._mock_volume.create_child.side_effect = self._raise_infinisdk + self._mock_volume.create_snapshot.side_effect = self._raise_infinisdk self.assertRaises(exception.VolumeBackendAPIException, self.driver.create_volume_from_snapshot, test_clone, test_snapshot) diff --git a/cinder/volume/drivers/infinidat.py b/cinder/volume/drivers/infinidat.py index 47c44154973..40b98dc221b 100644 --- a/cinder/volume/drivers/infinidat.py +++ b/cinder/volume/drivers/infinidat.py @@ -602,7 +602,7 @@ class InfiniboxVolumeDriver(san.SanISCSIDriver): """ infinidat_snapshot = self._get_infinidat_snapshot(snapshot) clone_name = self._make_volume_name(volume) + '-internal' - infinidat_clone = infinidat_snapshot.create_child(name=clone_name) + infinidat_clone = infinidat_snapshot.create_snapshot(name=clone_name) # we need a cinder-volume-like object to map the clone by name # (which is derived from the cinder id) but the clone is internal # so there is no such object. mock one