Skip to content

Commit

Permalink
Fall back to noop systemd_ready and systemd_status functions during d…
Browse files Browse the repository at this point in the history
…oc building

The systemd-python package can't be installed successfully during doc builds on
ReadTheDocs. Just ignore its functions during doc building.
  • Loading branch information
mineo committed Sep 2, 2018
1 parent 48c7554 commit 729ebe8
Showing 1 changed file with 25 additions and 10 deletions.
35 changes: 25 additions & 10 deletions sagbescheid/sagbescheid.py
Expand Up @@ -11,24 +11,39 @@
from functools import partial
from operator import attrgetter
from sys import exit
from systemd.daemon import booted, notify
from twisted.internet import defer, reactor
from twisted.python import log
from txdbus import client, error

try:
from systemd.daemon import booted, notify

def systemd_ready():
"""Signal to systemd that the service has successfully started.
"""
notify("READY=1")
def systemd_ready():
"""Signal to systemd that the service has successfully started.
"""
notify("READY=1")

def systemd_status(message):
"""Send a status `message` to systemd.
def systemd_status(message):
"""Send a status `message` to systemd.
:type message: str
"""
notify("STATUS={message}".format(message=message))
except ImportError:
# The systemd-python package can't be installed successfully on
# ReadTheDocs. Just ignore its functions during doc building.
def systemd_ready():
"""Signal to systemd that the service has successfully started.
"""
pass

def systemd_status(message):
"""Send a status `message` to systemd.
:type message: str
"""
pass

:type message: str
"""
notify("STATUS={message}".format(message=message))


@defer.inlineCallbacks
Expand Down

0 comments on commit 729ebe8

Please sign in to comment.