Commit 1698503a authored by Michael Hanselmann's avatar Michael Hanselmann
Browse files

cmdlib: Don't sort list of nodes if names are given



This makes _GetWantedNodes consistent wit _GetWantedInstances.
Signed-off-by: default avatarMichael Hanselmann <hansmi@google.com>
Reviewed-by: default avatarAdeodato Simo <dato@google.com>
parent 9f5a3645
......@@ -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):
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment