From 9c4f4dd6d012b467306264f4a5f8f5437a66ebcf Mon Sep 17 00:00:00 2001
From: Michael Hanselmann <hansmi@google.com>
Date: Thu, 24 Nov 2011 08:58:56 +0100
Subject: [PATCH] Fix pylint warning on unreachable code

Commit c50452c3186 added an exception when all instances should be
evacuated off a node, but did so in a way which made pylint complain
about unreachable code.

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
---
 lib/cmdlib.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/cmdlib.py b/lib/cmdlib.py
index 2e641d845..098a2e4b6 100644
--- a/lib/cmdlib.py
+++ b/lib/cmdlib.py
@@ -10148,6 +10148,7 @@ class LUNodeEvacuate(NoHooksLU):
     else:
       # All instances
       assert self.op.mode == constants.IALLOCATOR_NEVAC_ALL
+      inst_fn = _GetNodeInstances
       # TODO: In 2.6, change the iallocator interface to take an evacuation mode
       # per instance
       raise errors.OpPrereqError("Due to an issue with the iallocator"
@@ -10156,7 +10157,6 @@ class LUNodeEvacuate(NoHooksLU):
                                  " whether to evacuate primary or secondary"
                                  " instances",
                                  errors.ECODE_INVAL)
-      inst_fn = _GetNodeInstances
 
     return inst_fn(self.cfg, self.op.node_name)
 
-- 
GitLab