From fc8a6b8f3334c1352caafcede1e31d801fc146ba Mon Sep 17 00:00:00 2001 From: Iustin Pop <iustin@google.com> Date: Mon, 21 Dec 2009 16:51:40 +0100 Subject: [PATCH] Implement BuildHooksEnv for NoHooksLU This just adds a stub function that raises an assertion error; this accomplishes two things: - silences many pylint warnings - if we ever stumble upon this, a specific assertion error is (hopefully) clearer than just a not implemented error Signed-off-by: Iustin Pop <iustin@google.com> Reviewed-by: Olivier Tharan <olive@google.com> --- lib/cmdlib.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/lib/cmdlib.py b/lib/cmdlib.py index fc95613b0..13391e5ce 100644 --- a/lib/cmdlib.py +++ b/lib/cmdlib.py @@ -335,6 +335,14 @@ class NoHooksLU(LogicalUnit): # pylint: disable-msg=W0223 HPATH = None HTYPE = None + def BuildHooksEnv(self): + """Empty BuildHooksEnv for NoHooksLu. + + This just raises an error. + + """ + assert False, "BuildHooksEnv called for NoHooksLUs" + def _GetWantedNodes(lu, nodes): """Returns list of checked and expanded node names. -- GitLab