9.1.4.1.5. cobbler.modules.serializers package
9.1.4.1.5.1. Submodules
9.1.4.1.5.2. cobbler.modules.serializers.file module
Cobbler’s file-based object serializer. As of 9/2014, this is Cobbler’s default serializer and the most stable one. It uses multiple JSON files in /var/lib/cobbler/collections/distros, profiles, etc
Copyright 2006-2009, Red Hat, Inc and Others Michael DeHaan <michael.dehaan AT gmail>
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- cobbler.modules.serializers.file.deserialize(collection, topological: bool = True)[source]
Load a collection from file system.
- Parameters:
collection – The collection to deserialize.
topological – If the collection list should be sorted by the collection dict key ‘depth’ value or not.
- cobbler.modules.serializers.file.deserialize_raw(collection_types: str)[source]
Loads a collection from the disk.
- Parameters:
collection_types – The type of collection to load.
- Returns:
The loaded dictionary.
- cobbler.modules.serializers.file.register() str [source]
The mandatory Cobbler module registration hook.
- cobbler.modules.serializers.file.serialize(collection)[source]
Save a collection to file system
- Parameters:
collection – collection
- cobbler.modules.serializers.file.serialize_delete(collection, item)[source]
Delete a collection item from file system.
- Parameters:
collection – collection
item – collection item
9.1.4.1.5.3. cobbler.modules.serializers.mongodb module
Cobbler’s Mongo database based object serializer. Experimental version.
Copyright 2006-2009, Red Hat, Inc and Others Michael DeHaan <michael.dehaan AT gmail> James Cammarata <jimi@sngx.net>
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- cobbler.modules.serializers.mongodb.deserialize(collection, topological: bool = True)[source]
Load a collection from the database.
- Parameters:
collection – The collection to deserialize.
topological – If the collection list should be sorted by the collection dict depth value or not.
- cobbler.modules.serializers.mongodb.deserialize_raw(collection_type: str)[source]
Get a collection from mongodb and parse it into an object.
- Parameters:
collection_type – The collection type to fetch.
- Returns:
The first element of the collection requested.
- cobbler.modules.serializers.mongodb.register() str [source]
The mandatory Cobbler module registration hook.
- cobbler.modules.serializers.mongodb.serialize(collection)[source]
Save a collection to database
- Parameters:
collection – collection
- cobbler.modules.serializers.mongodb.serialize_delete(collection, item)[source]
Delete a collection item from database.
- Parameters:
collection – collection
item – collection item
9.1.4.1.5.4. Module contents
This module contains code to persist the in memory state of Cobbler on a target. The name of the target should be the name of the Python file. Cobbler is currently only tested against the file serializer.