diff options
author | Michael DeHaan <mdehaan@redhat.com> | 2008-01-31 15:41:32 -0500 |
---|---|---|
committer | Michael DeHaan <mdehaan@redhat.com> | 2008-01-31 15:41:32 -0500 |
commit | 09492171caa8555f1d1792796779b2c62c415886 (patch) | |
tree | 231c6cd4fe589b7ca408fc8bc975e8e29ddcc625 | |
parent | 10d7d85c1faf6bf46824060de04b02fd68b66ce8 (diff) | |
download | third_party-cobbler-09492171caa8555f1d1792796779b2c62c415886.tar.gz third_party-cobbler-09492171caa8555f1d1792796779b2c62c415886.tar.xz third_party-cobbler-09492171caa8555f1d1792796779b2c62c415886.zip |
Sort 'cobbler list' output
-rw-r--r-- | CHANGELOG | 1 | ||||
-rw-r--r-- | cobbler/commands.py | 11 |
2 files changed, 11 insertions, 1 deletions
@@ -9,6 +9,7 @@ Cobbler CHANGELOG - remove leading newline in rendered template files, which apparently breaks AutoYAST? - recursive syncs automatically sync all subobjects when editing parent objects (default behavior) - deletes can now be done recursively (optional --recursive on distro/profile remove) +- 'cobbler list' is now (re)sorted * Wed Jan 09 2007 - 0.7.1 - allow imports to force usage of a specific kickstart template with --kickstart diff --git a/cobbler/commands.py b/cobbler/commands.py index a566433..d97a6e1 100644 --- a/cobbler/commands.py +++ b/cobbler/commands.py @@ -286,7 +286,16 @@ class CobblerFunction: """ Print cobbler object tree as a, well, tree. """ - for item in collection: + + def sorter(a,b): + return cmp(a.name,b.name) + + collection2 = [] + for c in collection: + collection2.append(c) + collection2.sort(sorter) + + for item in collection2: print _("%(indent)s%(type)s %(name)s") % { "indent" : " " * level, "type" : item.TYPE_NAME, |