summaryrefslogtreecommitdiffstats
path: root/cobbler
diff options
context:
space:
mode:
authorMichael DeHaan <mdehaan@redhat.com>2008-01-31 15:41:32 -0500
committerMichael DeHaan <mdehaan@redhat.com>2008-01-31 15:41:32 -0500
commit09492171caa8555f1d1792796779b2c62c415886 (patch)
tree231c6cd4fe589b7ca408fc8bc975e8e29ddcc625 /cobbler
parent10d7d85c1faf6bf46824060de04b02fd68b66ce8 (diff)
downloadthird_party-cobbler-09492171caa8555f1d1792796779b2c62c415886.tar.gz
third_party-cobbler-09492171caa8555f1d1792796779b2c62c415886.tar.xz
third_party-cobbler-09492171caa8555f1d1792796779b2c62c415886.zip
Sort 'cobbler list' output
Diffstat (limited to 'cobbler')
-rw-r--r--cobbler/commands.py11
1 files changed, 10 insertions, 1 deletions
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,