From d281149ea0f860c7c862f7897710d2e1fcb681e7 Mon Sep 17 00:00:00 2001 From: Aswad Rangnekar Date: Wed, 30 Oct 2013 05:45:35 -0700 Subject: [PATCH] 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 --- cinder/volume/api.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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) -- 2.45.2