diff --git a/lib/ClusterShell/CLI/Nodeset.py b/lib/ClusterShell/CLI/Nodeset.py index 3c74268d..6b38e2b8 100755 --- a/lib/ClusterShell/CLI/Nodeset.py +++ b/lib/ClusterShell/CLI/Nodeset.py @@ -136,8 +136,9 @@ def command_list(options, xset, group_resolver): if options.listall: # useful: sources[0] is always the default or selected source sources = group_resolver.sources() - # do not print name of default group source unless -s specified - if sources and not options.groupsource: + # do not print the name of the current group source (either the default + # or the one specified by -s) + if sources: sources[0] = None else: sources = [options.groupsource] diff --git a/tests/CLINodesetTest.py b/tests/CLINodesetTest.py index fb487a98..cf8b510c 100644 --- a/tests/CLINodesetTest.py +++ b/tests/CLINodesetTest.py @@ -721,7 +721,7 @@ def test_039_list_all(self): self._nodeset_t(["-GL"], None, b"@bar\n@foo\n@moo\n@baz\n@norf\n@qux\n") self._nodeset_t(["--list-all", "-s", "other"], None, - b"@other:baz\n@other:norf\n@other:qux\n@test:bar\n@test:foo\n@test:moo\n") + b"@baz\n@norf\n@qux\n@test:bar\n@test:foo\n@test:moo\n") self._nodeset_t(["--list-all", "-G", "-s", "other"], None, b"@baz\n@norf\n@qux\n@bar\n@foo\n@moo\n") # 'other' source first