diff options
author | Michael DeHaan <mdehaan@redhat.com> | 2007-11-12 13:25:23 -0500 |
---|---|---|
committer | Michael DeHaan <mdehaan@redhat.com> | 2007-11-12 13:25:23 -0500 |
commit | 57f449cc30b59970b97d7ee4d74cc02a98e07e30 (patch) | |
tree | 24b59435eba407c06645eecfeed882c0b31c240b /cobbler/api.py | |
parent | a4dcebbff2db26dc22aadcc0f84328c19d52e48d (diff) | |
download | third_party-cobbler-57f449cc30b59970b97d7ee4d74cc02a98e07e30.tar.gz third_party-cobbler-57f449cc30b59970b97d7ee4d74cc02a98e07e30.tar.xz third_party-cobbler-57f449cc30b59970b97d7ee4d74cc02a98e07e30.zip |
Abstract out the modules system to allow for other types of modules, and to also centralize configuration/loading/access some more.
Diffstat (limited to 'cobbler/api.py')
-rw-r--r-- | cobbler/api.py | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/cobbler/api.py b/cobbler/api.py index 2a51c1a..b846c81 100644 --- a/cobbler/api.py +++ b/cobbler/api.py @@ -38,7 +38,7 @@ class BootAPI: self.__dict__ = self.__shared_state if not BootAPI.has_loaded: BootAPI.has_loaded = True - self.modules = module_loader.load_modules() + module_loader.load_modules() self._config = config.Config(self) self.deserialize() @@ -232,6 +232,20 @@ class BootAPI: """ return self._config.deserialize_raw(collection_name) + def get_module_by_name(self,module_name): + """ + Returns a loaded cobbler module named 'name', if one exists, else None. + """ + return module_loader.get_module_by_name(module_name) + + def get_module_from_file(self,section,name): + """ + Looks in /etc/cobbler/modules.conf for a section called 'section' + and a key called 'name', and then returns the module that corresponds + to the value of that key. + """ + return module_loader.get_module_from_file(section,name) + if __name__ == "__main__": api = BootAPI() print api.version() |