From: Aswad Rangnekar Date: Wed, 30 Oct 2013 12:45:35 +0000 (-0700) Subject: Remove unused db calls to fetch original metadata X-Git-Url: https://review.fuel-infra.org/gitweb?a=commitdiff_plain;h=d281149ea0f860c7c862f7897710d2e1fcb681e7;p=openstack-build%2Fcinder-build.git Remove unused db calls to fetch original metadata Remove unnecessary db calls made to fetch original metadata when delete flag is set to True. Closes-Bug: #1246291 Change-Id: If7483b8b21f71efa5e7c211b031170bc03eb6b9b --- diff --git a/cinder/volume/api.py b/cinder/volume/api.py index c17330d63..15bf95467 100644 --- a/cinder/volume/api.py +++ b/cinder/volume/api.py @@ -600,10 +600,10 @@ class API(base.Base): `metadata` argument will be deleted. """ - orig_meta = self.get_volume_metadata(context, volume) if delete: _metadata = metadata else: + orig_meta = self.get_volume_metadata(context, volume) _metadata = orig_meta.copy() _metadata.update(metadata) @@ -645,10 +645,10 @@ class API(base.Base): `metadata` argument will be deleted. """ - orig_meta = self.get_volume_admin_metadata(context, volume) if delete: _metadata = metadata else: + orig_meta = self.get_volume_admin_metadata(context, volume) _metadata = orig_meta.copy() _metadata.update(metadata) @@ -679,10 +679,10 @@ class API(base.Base): `metadata` argument will be deleted. """ - orig_meta = self.get_snapshot_metadata(context, snapshot) if delete: _metadata = metadata else: + orig_meta = self.get_snapshot_metadata(context, snapshot) _metadata = orig_meta.copy() _metadata.update(metadata)