From: john-griffith Date: Wed, 20 Mar 2013 18:24:36 +0000 (-0600) Subject: Speedup solidfire unit tests X-Git-Url: https://review.fuel-infra.org/gitweb?a=commitdiff_plain;h=cf1ec9ca6668dc3f4a7cd453d16dc4ced1d97c68;p=openstack-build%2Fcinder-build.git Speedup solidfire unit tests The SolidFire driver has a sleep that's used in a retry loop. This sleep was being called every iteration of the loop though (instead of just when the call failed). This made SolidFire the slowest test in the unit tests, and obviously it's just stupid anyway. So this change fixes that and only performs the sleep if the call actually failed. Change-Id: I560f2fdb6bf16a6a9b26184234225349ab62e816 --- diff --git a/cinder/volume/drivers/solidfire.py b/cinder/volume/drivers/solidfire.py index 0b7966cbf..3f6f21641 100644 --- a/cinder/volume/drivers/solidfire.py +++ b/cinder/volume/drivers/solidfire.py @@ -267,7 +267,8 @@ class SolidFire(SanISCSIDriver): iqn = v['iqn'] found_volume = True break - time.sleep(2) + if not found_volume: + time.sleep(2) iteration_count += 1 if not found_volume: