From 729d86d3651c1f0b8fbb97d1e60d1b37f61101ff Mon Sep 17 00:00:00 2001 From: Nitin Madhok Date: Sun, 17 Jul 2016 20:09:30 -0400 Subject: [PATCH] Remove force option from create_snapshots_in_db() Removing force option from create_snapshots_in_db() since it is not needed because this function is only used by create_cgsnapshot() and the force flag is always True. Change-Id: I04f67334168651a9e1da06179b0cf93b640c95ca Signed-off-by: Nitin Madhok --- cinder/consistencygroup/api.py | 2 +- cinder/tests/unit/test_volume.py | 1 - cinder/volume/api.py | 4 ++-- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/cinder/consistencygroup/api.py b/cinder/consistencygroup/api.py index e51552acf..efddb1b58 100644 --- a/cinder/consistencygroup/api.py +++ b/cinder/consistencygroup/api.py @@ -731,7 +731,7 @@ class API(base.Base): snap_desc = cgsnapshot.description with group.obj_as_admin(): self.volume_api.create_snapshots_in_db( - context, group.volumes, snap_name, snap_desc, True, + context, group.volumes, snap_name, snap_desc, cgsnapshot_id) except Exception: diff --git a/cinder/tests/unit/test_volume.py b/cinder/tests/unit/test_volume.py index 8f5e1796d..9e2f85dc5 100644 --- a/cinder/tests/unit/test_volume.py +++ b/cinder/tests/unit/test_volume.py @@ -3177,7 +3177,6 @@ class VolumeTestCase(BaseVolumeTestCase): [test_volume], 'fake_name', 'fake_description', - False, fake.CONSISTENCY_GROUP_ID) def test_cannot_delete_volume_in_use(self): diff --git a/cinder/volume/api.py b/cinder/volume/api.py index 3945238dd..07e33593d 100644 --- a/cinder/volume/api.py +++ b/cinder/volume/api.py @@ -793,10 +793,10 @@ class API(base.Base): def create_snapshots_in_db(self, context, volume_list, name, description, - force, cgsnapshot_id): + cgsnapshot_id): snapshot_list = [] for volume in volume_list: - self._create_snapshot_in_db_validate(context, volume, force) + self._create_snapshot_in_db_validate(context, volume, True) if volume['status'] == 'error': msg = _("The snapshot cannot be created when the volume is " "in error status.")