Dynamic method creation can be used to create the methods
for the cobbler nouns. A single loop can create all the wrappers:
Adding the following code to api.__init__ will create all
the find_xxxx() methods:
for what in
['distro','profile','system','repo','image','network']:
codestr='''
def find_%s(self, name=None, return_list=False, no_errors=False, **kargs):
return self._config.%ss().find(name=name, return_list=return_list,
no_errors=no_errors, **kargs)
''' % (what,what)
d={}
exec codestr.strip() in d
setattr(self.__class__, 'find_%s' % what, d['find_%s' % what])
Regards,
Peter