From 1492cca7a27fd8024a1ad58fe38924f2939f85f8 Mon Sep 17 00:00:00 2001
From: Iustin Pop <iustin@google.com>
Date: Tue, 20 Jan 2009 10:12:00 +0000
Subject: [PATCH] Some small fixes in cmdlib

Reviewed-by: ultrotter
---
 lib/cmdlib.py | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/lib/cmdlib.py b/lib/cmdlib.py
index ce5edc602..2614f2413 100644
--- a/lib/cmdlib.py
+++ b/lib/cmdlib.py
@@ -1495,8 +1495,7 @@ def _WaitForSync(lu, instance, oneshot=False, unlock=False):
       continue
     rstats = rstats.data
     retries = 0
-    for i in range(len(rstats)):
-      mstat = rstats[i]
+    for i, mstat in enumerate(rstats):
       if mstat is None:
         lu.LogWarning("Can't compute data for node %s/%s",
                            node, instance.disks[i].iv_name)
@@ -5041,7 +5040,7 @@ class LUReplaceDisks(LogicalUnit):
       try:
         _CreateSingleBlockDev(self, new_node, instance, new_drbd,
                               _GetInstanceInfoText(instance), False)
-      except error.BlockDeviceError:
+      except errors.BlockDeviceError:
         self.cfg.ReleaseDRBDMinors(instance.name)
         raise
 
@@ -5705,7 +5704,7 @@ class LUSetInstanceParams(LogicalUnit):
           try:
             _CreateBlockDev(self, node, instance, new_disk,
                             f_create, info, f_create)
-          except error.OpExecError, err:
+          except errors.OpExecError, err:
             self.LogWarning("Failed to create volume %s (%s) on"
                             " node %s: %s",
                             new_disk.iv_name, new_disk, node, err)
-- 
GitLab