diff --git a/manila/share/drivers/huawei/v3/connection.py b/manila/share/drivers/huawei/v3/connection.py index 84944aba88..45c6ee8701 100644 --- a/manila/share/drivers/huawei/v3/connection.py +++ b/manila/share/drivers/huawei/v3/connection.py @@ -194,10 +194,9 @@ class V3StorageConnection(driver.HuaweiBase): snap_name = snapshot['id'] share_proto = snapshot['share']['share_proto'] - share_name = self.helper._get_share_name_by_id( - snapshot['share']['share_id']) share_url_type = self.helper._get_share_url_type(share_proto) - share = self.helper._get_share_by_name(share_name, share_url_type) + share = self.helper._get_share_by_name(snapshot['share_name'], + share_url_type) if not share: err_msg = _('Can not create snapshot,' @@ -216,9 +215,7 @@ class V3StorageConnection(driver.HuaweiBase): LOG.debug("Delete a snapshot.") snap_name = snapshot['id'] - share_name = self.helper._get_share_name_by_id( - snapshot['share']['share_id']) - sharefsid = self.helper._get_fsid_by_name(share_name) + sharefsid = self.helper._get_fsid_by_name(snapshot['share_name']) if sharefsid is None: LOG.warning(_LW('Delete snapshot share id %s fs has been ' diff --git a/manila/share/drivers/huawei/v3/helper.py b/manila/share/drivers/huawei/v3/helper.py index 335fec2acc..60c1fe0504 100644 --- a/manila/share/drivers/huawei/v3/helper.py +++ b/manila/share/drivers/huawei/v3/helper.py @@ -612,10 +612,6 @@ class RestHelper(object): share_path = "/" + share_name.replace("-", "_") + "/" return share_path - def _get_share_name_by_id(self, share_id): - share_name = "share_" + share_id - return share_name - def _get_share_name_by_export_location(self, export_location, share_proto): export_location_split = None share_name = None diff --git a/manila/tests/share/drivers/huawei/test_huawei_nas.py b/manila/tests/share/drivers/huawei/test_huawei_nas.py index 40c65cc6df..68e00c3bcc 100644 --- a/manila/tests/share/drivers/huawei/test_huawei_nas.py +++ b/manila/tests/share/drivers/huawei/test_huawei_nas.py @@ -563,6 +563,7 @@ class HuaweiShareDriverTestCase(test.TestCase): 'display_name': 'snapshot', 'name': 'fake_snapshot_name', 'size': 1, + 'share_name': 'share_fake_uuid', 'share': { 'share_name': 'share_fake_uuid', 'share_id': 'fake_uuid', @@ -576,6 +577,7 @@ class HuaweiShareDriverTestCase(test.TestCase): 'display_name': 'snapshot', 'name': 'fake_snapshot_name', 'size': 1, + 'share_name': 'share_fake_uuid', 'share': { 'share_name': 'share_fake_uuid', 'share_id': 'fake_uuid',