]> review.fuel-infra Code Review - openstack-build/cinder-build.git/commitdiff
Minor optimization
authorlisali <xiaoyan.li@intel.com>
Fri, 28 Aug 2015 09:50:14 +0000 (09:50 +0000)
committerlisali <xiaoyan.li@intel.com>
Mon, 31 Aug 2015 05:18:39 +0000 (13:18 +0800)
Remove the unnecessary comparison statements in manager.py.

Change-Id: If276aa78be089e75aa56310eb606ba3dccb9b9b1

cinder/volume/manager.py

index e765693fbbfde0dd8e6179d01c1f14c4530b13fa..6b2b3db0ec0cdfad40038096f3312ad8fa0dc0f2 100644 (file)
@@ -1827,10 +1827,7 @@ class VolumeManager(manager.SchedulerDependentManager):
 
         volume_ref = self.db.volume_get(ctxt, volume_id)
         status_update = {'status': volume_ref['previous_status']}
-        if context.project_id != volume_ref['project_id']:
-            project_id = volume_ref['project_id']
-        else:
-            project_id = context.project_id
+        project_id = volume_ref['project_id']
 
         try:
             # NOTE(flaper87): Verify the driver is enabled