summaryrefslogtreecommitdiffstats
path: root/cobbler/cobbler.py
diff options
context:
space:
mode:
authorMichael DeHaan <mdehaan@mdehaan.rdu.redhat.com>2007-04-27 17:19:37 -0400
committerMichael DeHaan <mdehaan@mdehaan.rdu.redhat.com>2007-04-27 17:19:37 -0400
commit774b9d931ebda69b9b149a0696a4cefa9c747d99 (patch)
tree2cbca08962cdc5323af55bd79216dd089cca3e8e /cobbler/cobbler.py
parente7ffce896809af8db172ac274dfcdd9146f15798 (diff)
downloadthird_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-xcobbler/cobbler.py27
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