diff options
-rw-r--r-- | CHANGELOG | 2 | ||||
-rw-r--r-- | MANIFEST.in | 1 | ||||
-rw-r--r-- | cobbler.spec | 1 | ||||
-rw-r--r-- | cobbler/serializer.py | 14 | ||||
-rw-r--r-- | config/modules.conf | 7 | ||||
-rw-r--r-- | setup.py | 1 |
6 files changed, 24 insertions, 2 deletions
@@ -8,7 +8,7 @@ Cobbler CHANGELOG - allow multiple (comma-seperated) values for --virt-size - removed deprecated 'enchant' function (use SSH and koan instead) - cleanup of a few unused settings -- backend work to allow for multiple config file formats/loaders/serializers +- allow for serialization modules to be selected in /etc/cobbler/modules.conf * Thu Aug 30 2007 - 0.6.1 - re enable --resolve in yumdownloader (cobbler repo mgmt feature) diff --git a/MANIFEST.in b/MANIFEST.in index ce9dd12..c549f91 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -6,6 +6,7 @@ include config/rsync.exclude include config/cobblerd include config/cobblerd_rotate include config/cobbler_hosts +include config/modules.conf recursive-include templates *.template recursive-include kickstarts *.ks include docs/cobbler.1.gz diff --git a/cobbler.spec b/cobbler.spec index 3e0a81f..822e702 100644 --- a/cobbler.spec +++ b/cobbler.spec @@ -104,6 +104,7 @@ test "x$RPM_BUILD_ROOT" != "x" && rm -rf $RPM_BUILD_ROOT %config(noreplace) /etc/cobbler/pxesystem_ia64.template %config(noreplace) /etc/cobbler/rsync.exclude %config(noreplace) /etc/logrotate.d/cobblerd_rotate +%config(noreplace) /etc/cobbler/modules.conf %dir %{python_sitelib}/cobbler %dir %{python_sitelib}/cobbler/yaml %dir %{python_sitelib}/cobbler/modules diff --git a/cobbler/serializer.py b/cobbler/serializer.py index bdfbb65..35ff2d9 100644 --- a/cobbler/serializer.py +++ b/cobbler/serializer.py @@ -23,8 +23,11 @@ from cexceptions import * import utils import api as cobbler_api import modules.serializer_yaml as serializer_yaml +import ConfigParser MODULE_CACHE = {} +cp = ConfigParser.ConfigParser() +cp.read("/etc/cobbler/modules.conf") def serialize(obj): """ @@ -43,7 +46,16 @@ def deserialize(obj,topological=False): def __get_storage_module(collection_type): + + if not MODULE_CACHE.has_key(collection_type): + value = cp.get("serializers",collection_type) + module = cobbler_api.BootAPI().modules[value] + MODULE_CACHE[collection_type] = module + return module + else: + return MODULE_CACHE[collection_type] + # FIXME: this is always fixed currently, and should not be. - return cobbler_api.BootAPI().modules["serializer_yaml"] + return diff --git a/config/modules.conf b/config/modules.conf new file mode 100644 index 0000000..fbe710c --- /dev/null +++ b/config/modules.conf @@ -0,0 +1,7 @@ +[serializers] +settings = serializer_yaml +distro = serializer_yaml +profile = serializer_yaml +system = serializer_yaml +repo = serializer_yaml + @@ -67,6 +67,7 @@ if __name__ == "__main__": (etcpath, ['templates/pxesystem.template']), (etcpath, ['templates/pxesystem_ia64.template']), (etcpath, ['templates/pxeprofile.template']), + (etcpath, ['config/modules.conf']), (snippets, ['snippets/partition_select']), (manpath, ['docs/cobbler.1.gz']), (etcpath, ['config/rsync.exclude']), |