diff options
author | Michael DeHaan <mdehaan@mdehaan.rdu.redhat.com> | 2007-04-27 17:19:37 -0400 |
---|---|---|
committer | Michael DeHaan <mdehaan@mdehaan.rdu.redhat.com> | 2007-04-27 17:19:37 -0400 |
commit | 774b9d931ebda69b9b149a0696a4cefa9c747d99 (patch) | |
tree | 2cbca08962cdc5323af55bd79216dd089cca3e8e /cobbler/cobbler.py | |
parent | e7ffce896809af8db172ac274dfcdd9146f15798 (diff) | |
download | third_party-cobbler-774b9d931ebda69b9b149a0696a4cefa9c747d99.tar.gz third_party-cobbler-774b9d931ebda69b9b149a0696a4cefa9c747d99.tar.xz third_party-cobbler-774b9d931ebda69b9b149a0696a4cefa9c747d99.zip |
Allow "list" to show specifics of a specific object when given as a
parameter.
Diffstat (limited to 'cobbler/cobbler.py')
-rwxr-xr-x | cobbler/cobbler.py | 27 |
1 files changed, 23 insertions, 4 deletions
diff --git a/cobbler/cobbler.py b/cobbler/cobbler.py index ab61ec1..90f79e5 100755 --- a/cobbler/cobbler.py +++ b/cobbler/cobbler.py @@ -179,17 +179,36 @@ class BootCLI: print " %s" % name return True + def __list_names2(self, collection, args): + for p in args: + obj = collection.find(p) + if obj is not None: + print obj.printable() + return True + def system_list(self, args): - return self.__list_names(self.api.systems()) + if len(args) > 0: + self.__list_names2(self.api.systems(), args) + else: + return self.__list_names(self.api.systems()) def distro_list(self, args): - return self.__list_names(self.api.distros()) + if len(args) > 0: + return self.__list_names2(self.api.distros(),args) + else: + return self.__list_names(self.api.distros()) def profile_list(self, args): - return self.__list_names(self.api.profiles()) + if len(args) > 0: + return self.__list_names2(self.api.profiles(),args) + else: + return self.__list_names(self.api.profiles()) def repo_list(self, args): - return self.__list_names(self.api.repos()) + if len(args) > 0: + return self.__list_names2(self.api.repos(),args) + else: + return self.__list_names(self.api.repos()) ############################################################### # UTILITY FUNCTIONS |