From f3ed9d436bdac7368068853991e9314fbccc0a00 Mon Sep 17 00:00:00 2001 From: David Hill Date: Mon, 19 Aug 2019 16:28:45 -0400 Subject: [PATCH] RemoteFS: Use dest vol id instead of source id in snapshot temp name Use the destination volume id instead of the source volume id in the temporary snapshot file name. This is likely not strictly needed after Change I64e041fe, which ensures that multiple clone volume operations won't run simultaneously from the same source volume, but is still a good idea to ensure that there is less that can go wrong in a failure scenario. Change-Id: I5bd185d04dbda673a5882d61aaab7acdd99b74a6 Related-Bug: #1851512 Closes-Bug: #1840712 --- cinder/tests/unit/volume/drivers/test_remotefs.py | 2 +- cinder/volume/drivers/remotefs.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/cinder/tests/unit/volume/drivers/test_remotefs.py b/cinder/tests/unit/volume/drivers/test_remotefs.py index b9d0552e2cd..127f733d06b 100644 --- a/cinder/tests/unit/volume/drivers/test_remotefs.py +++ b/cinder/tests/unit/volume/drivers/test_remotefs.py @@ -644,7 +644,7 @@ class RemoteFsSnapDriverTestCase(test.TestCase): 'status': fields.SnapshotStatus.CREATING, 'progress': '0%', 'volume_size': src_vref.size, - 'display_name': 'tmp-snap-%s' % src_vref['id'], + 'display_name': 'tmp-snap-%s' % volume.id, 'display_description': None, 'volume_type_id': src_vref.volume_type_id, 'encryption_key_id': None, diff --git a/cinder/volume/drivers/remotefs.py b/cinder/volume/drivers/remotefs.py index 36c1ce081de..cad44a35032 100644 --- a/cinder/volume/drivers/remotefs.py +++ b/cinder/volume/drivers/remotefs.py @@ -1058,7 +1058,7 @@ class RemoteFSSnapDriverBase(RemoteFSDriver): 'status': fields.SnapshotStatus.CREATING, 'progress': '0%', 'volume_size': src_vref.size, - 'display_name': 'tmp-snap-%s' % src_vref.id, + 'display_name': 'tmp-snap-%s' % volume.id, 'display_description': None, 'volume_type_id': src_vref.volume_type_id, 'encryption_key_id': src_vref.encryption_key_id,