From cf1ec9ca6668dc3f4a7cd453d16dc4ced1d97c68 Mon Sep 17 00:00:00 2001 From: john-griffith Date: Wed, 20 Mar 2013 12:24:36 -0600 Subject: [PATCH] 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 --- cinder/volume/drivers/solidfire.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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: -- 2.45.2