diff options
author | Michael DeHaan <mdehaan@redhat.com> | 2006-05-09 12:30:53 -0400 |
---|---|---|
committer | Jim Meyering <jim@meyering.net> | 2006-05-09 12:30:53 -0400 |
commit | 4494a9f367838913f1898faef81ba27a849008aa (patch) | |
tree | 950b946f154f40a754a62a94a0536e9e5b32922d /cobbler/collection.py | |
parent | 804a564ac24ff22cd46583fa98d8140a8b10f476 (diff) | |
download | third_party-cobbler-4494a9f367838913f1898faef81ba27a849008aa.tar.gz third_party-cobbler-4494a9f367838913f1898faef81ba27a849008aa.tar.xz third_party-cobbler-4494a9f367838913f1898faef81ba27a849008aa.zip |
Simplified the command line, made a better 'list' function, some string and exception
cleanup.
Diffstat (limited to 'cobbler/collection.py')
-rw-r--r-- | cobbler/collection.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/cobbler/collection.py b/cobbler/collection.py index 9c58295..937c528 100644 --- a/cobbler/collection.py +++ b/cobbler/collection.py @@ -81,9 +81,12 @@ class Collection(serializable.Serializable): for reading by humans or parsing from scripts. Actually scripts would be better off reading the YAML in the config files directly. """ - values = map(lambda(a): a.printable(), sorted(self.listing.values())) + values = sorted(self.listing.values()) + results = [] + for i,v in enumerate(values): + results.append(v.printable(1+i)) if len(values) > 0: - return "\n\n".join(values) + return "\n\n".join(results) else: return cobbler_msg.lookup("empty_list") |