From 1698503acb4f8575fcccb25f90898e738fbe1176 Mon Sep 17 00:00:00 2001 From: Michael Hanselmann <hansmi@google.com> Date: Mon, 6 Dec 2010 19:46:55 +0100 Subject: [PATCH] cmdlib: Don't sort list of nodes if names are given This makes _GetWantedNodes consistent wit _GetWantedInstances. Signed-off-by: Michael Hanselmann <hansmi@google.com> Reviewed-by: Adeodato Simo <dato@google.com> --- lib/cmdlib.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/lib/cmdlib.py b/lib/cmdlib.py index ab8cf39fb..f0b6dba68 100644 --- a/lib/cmdlib.py +++ b/lib/cmdlib.py @@ -577,12 +577,10 @@ def _GetWantedNodes(lu, nodes): @raise errors.ProgrammerError: if the nodes parameter is wrong type """ - if not nodes: - raise errors.ProgrammerError("_GetWantedNodes should only be called with a" - " non-empty list of nodes whose name is to be expanded.") + if nodes: + return [_ExpandNodeName(lu.cfg, name) for name in nodes] - wanted = [_ExpandNodeName(lu.cfg, name) for name in nodes] - return utils.NiceSort(wanted) + return utils.NiceSort(lu.cfg.GetNodeList()) def _GetWantedInstances(lu, instances): -- GitLab