8. cobbler package

8.2. Submodules

8.3. cobbler.api module

8.4. cobbler.autoinstall_manager module

8.5. cobbler.autoinstallgen module

8.6. cobbler.cexceptions module

Custom exceptions for Cobbler

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

exception cobbler.cexceptions.CX(value, *args)[source]

Bases: cobbler.cexceptions.CobblerException

This is a general exception which get’s thrown often inside Cobbler.

exception cobbler.cexceptions.CobblerException(value, *args)[source]

Bases: Exception

This is the default Cobbler exception where all other exceptions are inheriting from.

exception cobbler.cexceptions.FileNotFoundException(value, *args)[source]

Bases: cobbler.cexceptions.CobblerException

This means that the required file was not found during the process of opening it.

exception cobbler.cexceptions.NotImplementedException(value, *args)[source]

Bases: cobbler.cexceptions.CobblerException

On the command line interface not everything is always implemented. This is the exception which stated this.

8.7. cobbler.cli module

8.8. cobbler.clogger module

Python standard logging doesn’t super-intelligent and won’t expose filehandles, which we want. So we’re not using it.

Copyright 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

class cobbler.clogger.Logger(logfile=None)[source]

Bases: object

Logger class for Cobbler which is wrapped around the Python3 standard logger.

Please don’t use this. Utilize the standard logger from Python3 so we can get rid of this eventually.

critical(msg: str)[source]

A critical message which is related to a problem which will halt Cobbler.

Parameters:msg – The message to be logged.
debug(msg: str)[source]

A message which is useful for finding errors or performance problems. Should not be visible in the production usage of Cobbler.

Parameters:msg – The message to be logged.
error(msg: str)[source]

An error message which means that Cobbler will not halt but the future actions may not be executed correctly.

Parameters:msg – The message to be logged.
flat(msg: str)[source]

This uses the print function from the std library. Avoid using this. This is only used for the report command in cobbler/actions/report.py

Parameters:msg – The message to be logged.
info(msg: str)[source]

An informational message which should be written to the target log.

Parameters:msg – The message to be logged.
warning(msg: str)[source]

A warning message which could possibly indicate performance or functional problems.

Parameters:msg – The message to be logged.

8.9. cobbler.cobblerd module

8.10. cobbler.configgen module

8.11. cobbler.download_manager module

Cobbler DownloadManager

Copyright 2018, Jorgen Maas <jorgen.maas@gmail.com>

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

class cobbler.download_manager.DownloadManager(collection_mgr, logger=None)[source]

Bases: object

download_file(url, dst, proxies=None, cert=None)[source]

Donwload a file from a URL and save it to any disc location.

Parameters:
  • url – The URL the request.
  • dst – The destination file path.
  • proxies – Override the default Cobbler proxies.
  • cert – Override the default Cobbler certs.
urlread(url, proxies=None, cert=None)[source]

Read the content of a given URL and pass the requests. Response object to the caller.

Parameters:
  • url – The URL the request.
  • proxies – Override the default Cobbler proxies.
  • cert – Override the default Cobbler certs.
Returns:

The Python requests.Response object.

8.12. cobbler.field_info module

Deprecated fields that have been renamed, but we need to account for them appearing in older datastructs that may not have been saved since the code change.

8.13. cobbler.module_loader module

8.14. cobbler.power_manager module

8.15. cobbler.remote module

8.16. cobbler.resource module

8.17. cobbler.serializer module

8.18. cobbler.services module

8.19. cobbler.settings module

8.20. cobbler.templar module

8.21. cobbler.template_api module

8.22. cobbler.tftpgen module

8.23. cobbler.utils module

8.24. cobbler.validate module

Copyright 2014-2015. Jorgen Maas <jorgen.maas@gmail.com>

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.validate.hostname(dnsname: str) → str[source]

Validate the DNS name.

Parameters:dnsname – Hostname or FQDN
Returns:dnsname
Raises:CX – If the Hostname/FQDN is not a string or in an invalid format.
cobbler.validate.ipv4_address(addr: str) → str[source]

Validate an IPv4 address.

Parameters:addr – IPv4 address
Returns:str addr or CX
cobbler.validate.ipv4_netmask(addr: str) → str[source]

Validate an IPv4 netmask.

Parameters:addr – IPv4 netmask
Returns:str addr or CX
cobbler.validate.ipv6_address(addr: str) → str[source]

Validate an IPv6 address.

Parameters:addr – IPv6 address
Returns:The IPv6 address.
cobbler.validate.mac_address(mac: str, for_item=True) → str[source]

Validate as an Eternet MAC address.

Parameters:
  • mac – MAC address
  • for_item – If the check should be performed for an item or not.
Returns:

str mac or CX

cobbler.validate.name_servers(nameservers: Union[str, list], for_item: bool = True) → Union[str, list][source]

Validate nameservers IP addresses, works for IPv4 and IPv6

Parameters:
  • nameservers – string or list of nameserver addresses
  • for_item – enable/disable special handling for Item objects
Returns:

The list of valid nameservers.

Validate nameservers search domains.

Parameters:
  • search – One or more search domains to validate.
  • for_item – (enable/disable special handling for Item objects)
Returns:

The list of valid nameservers.

cobbler.validate.object_name(name: str, parent: str) → str[source]

Validate the object name.

Parameters:
  • name – object name
  • parent – Parent object name
Returns:

name or CX

cobbler.validate.validate_autoinstall_script_name(name: str) → bool[source]

This validates if the name given for the script is valid in the context of the API call made. It will be handed to tftpgen.py#generate_script in the end.

Parameters:name – The name of the script. Will end up being a filename. May have an extension but should never be a path.
Returns:If this is a valid script name or not.
cobbler.validate.validate_obj_id(object_id: str) → bool[source]
Parameters:object_id
Returns:True in case it is one, False otherwise.
cobbler.validate.validate_obj_name(object_name: str) → bool[source]
Parameters:object_name
Returns:
cobbler.validate.validate_obj_type(object_type: str) → bool[source]
Parameters:object_type
Returns:
cobbler.validate.validate_uuid(possible_uuid: str) → bool[source]

Validate if the handed string is a valid UUIDv4.

Parameters:possible_uuid – The str with the UUID.
Returns:True in case it is one, False otherwise.

8.25. cobbler.yumgen module

8.26. Module contents