From be1ba2bd70e773eb2a0bf554aeb9b0ec800c94bb Mon Sep 17 00:00:00 2001
From: Iustin Pop <iustin@google.com>
Date: Mon, 7 Jan 2008 13:28:13 +0000
Subject: [PATCH] Improve speed of activating block devs

This patch fixes the double attach operation in bdev.AttachOrAssemble,
which was an indentation mistake in the first place.

Reviewed-by: imsnah
---
 lib/bdev.py | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/lib/bdev.py b/lib/bdev.py
index 8b2797191..fb9d4e1e7 100644
--- a/lib/bdev.py
+++ b/lib/bdev.py
@@ -2295,10 +2295,10 @@ def AttachOrAssemble(dev_type, unique_id, children):
   device = DEV_MAP[dev_type](unique_id, children)
   if not device.Attach():
     device.Assemble()
-  if not device.Attach():
-    raise errors.BlockDeviceError("Can't find a valid block device for"
-                                  " %s/%s/%s" %
-                                  (dev_type, unique_id, children))
+    if not device.Attach():
+      raise errors.BlockDeviceError("Can't find a valid block device for"
+                                    " %s/%s/%s" %
+                                    (dev_type, unique_id, children))
   return device
 
 
-- 
GitLab