From b5fca83a12991a8e421fcb0e5c5d49baee8764cc Mon Sep 17 00:00:00 2001 From: liangjingtao Date: Wed, 6 Jul 2016 22:04:54 +0800 Subject: [PATCH] Snapshot object has no attribute about size Snapshot object has no attribute about size,but some unit tests still use snapshot['size'].We should use snapshot['volume_size'] to modify it correctly.This patch will fix it. Change-Id: Ibe237334482fc2decdd23181d1843cd19df95bfa Closes-Bug: #1599522 --- cinder/tests/unit/test_gpfs.py | 4 ++-- cinder/tests/unit/test_infortrend_cli.py | 1 - 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/cinder/tests/unit/test_gpfs.py b/cinder/tests/unit/test_gpfs.py index 9565663e10f..2968195e460 100644 --- a/cinder/tests/unit/test_gpfs.py +++ b/cinder/tests/unit/test_gpfs.py @@ -1812,7 +1812,7 @@ class GPFSDriverTestCase(test.TestCase): snapshot = {} snapshot['id'] = fake.SNAPSHOT_ID snapshot['display_name'] = 'test-snap' - snapshot['size'] = 1000 + snapshot['volume_size'] = 1000 snapshot['volume_id'] = fake.VOLUME_ID snapshot['status'] = 'available' snapshot['snapshot_metadata'] = [] @@ -1906,7 +1906,7 @@ class GPFSNFSDriverTestCase(test.TestCase): snapshot = {} snapshot['id'] = '12345' snapshot['name'] = 'test-snap' - snapshot['size'] = 1000 + snapshot['volume_size'] = 1000 snapshot['volume_id'] = '123456' snapshot['status'] = 'available' return snapshot diff --git a/cinder/tests/unit/test_infortrend_cli.py b/cinder/tests/unit/test_infortrend_cli.py index 3534385eb7a..6b752ee4e95 100644 --- a/cinder/tests/unit/test_infortrend_cli.py +++ b/cinder/tests/unit/test_infortrend_cli.py @@ -110,7 +110,6 @@ class InfortrendCLITestData(object): test_snapshot = { 'id': 'ffa9bc5e-1172-4021-acaf-cdcd78a9584d', 'volume_id': test_volume['id'], - 'size': 2, 'volume_name': test_volume['name'], 'volume_size': 2, 'project_id': 'project',