8000 Fix docs generation error from Sphinx by nodeg · Pull Request #2633 · cobbler/cobbler · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Fix docs generation error from Sphinx #2633

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
May 12, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions cobbler/cobblerd.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,7 @@
from cobbler import remote, utils
from cobbler.api import CobblerAPI

# FIXME: Fix the absolute path and logging dependency on it.
if os.geteuid() == 0:
if os.geteuid() == 0 and os.path.exists('/etc/cobbler/logging_config.conf'):
logging.config.fileConfig('/etc/cobbler/logging_config.conf')


Expand Down
16 changes: 12 additions & 4 deletions cobbler/template_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
02110-1301 USA
"""
import logging
import os.path
import re
from typing import Match, Optional, TextIO, Tuple, Union
Expand All @@ -34,6 +35,8 @@
# This class is defined using the Cheetah language. Using the 'compile' function we can compile the source directly into
# a Python class. This class will allow us to define the cheetah builtins.

logger = logging.getLogger()


def read_macro_file(location='/etc/cobbler/cheetah_macros'):
if not os.path.exists(location):
Expand All @@ -43,10 +46,15 @@ def read_macro_file(location='/etc/cobbler/cheetah_macros'):


def generate_cheetah_macros():
return Template.compile(
source=read_macro_file(),
moduleName="cobbler.template_api",
className="CheetahMacros")
try:
macro_file = read_macro_file()
return Template.compile(
source=macro_file,
moduleName="cobbler.template_api",
className="CheetahMacros")
except FileNotFoundException:
logger.warning("Cheetah Macros file note found. Using empty template.")
return Template.compile(source="")


class CobblerTemplate(generate_cheetah_macros()):
Expand Down
8 changes: 0 additions & 8 deletions docs/code-autodoc/cobbler.actions.rst
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,6 @@ cobbler.actions.hardlink module
:undoc-members:
:show-inheritance:

cobbler.actions.litesync module
-------------------------------

.. automodule:: cobbler.actions.litesync
:members:
:undoc-members:
:show-inheritance:

cobbler.actions.log module
--------------------------

Expand Down
8 changes: 0 additions & 8 deletions docs/code-autodoc/cobbler.modules.managers.rst
Original file line number Diff line number Diff line change
Expand Up @@ -60,14 +60,6 @@ cobbler.modules.managers.ndjbdns module
:undoc-members:
:show-inheritance:

cobbler.modules.managers.tftpd\_py module
-----------------------------------------

.. automodule:: cobbler.modules.managers.tftpd_py
:members:
:undoc-members:
:show-inheritance:


Module contents
---------------
Expand Down
0