server: fix systemd variable scope
Change 31280 introduced an error where an import was overridden, which leads python to consider it a local variable, preventing access to the systemd import. (TODO: a better way to handle the systemd import?) Fixes: #4732 Change-Id: I5188a8737392bd8befcdfa9af044a21be9af908a Reviewed-on: https://forge.frm2.tum.de/review/c/secop/frappy/+/31386 Tested-by: Jenkins Automated Tests <pedersen+jenkins@frm2.tum.de> Reviewed-by: Alexander Zaft <a.zaft@fz-juelich.de>
This commit is contained in:
@@ -130,14 +130,15 @@ class Server:
|
|||||||
pass
|
pass
|
||||||
|
|
||||||
def run(self):
|
def run(self):
|
||||||
|
global systemd # pylint: disable=global-statement
|
||||||
while self._restart:
|
while self._restart:
|
||||||
self._restart = False
|
self._restart = False
|
||||||
try:
|
try:
|
||||||
# TODO: make systemd notifications configurable
|
# TODO: make systemd notifications configurable
|
||||||
if systemd: # pylint: disable=used-before-assignment
|
if systemd:
|
||||||
systemd.daemon.notify("STATUS=initializing")
|
systemd.daemon.notify("STATUS=initializing")
|
||||||
except Exception:
|
except Exception:
|
||||||
systemd = None # pylint: disable=redefined-outer-name
|
systemd = None
|
||||||
try:
|
try:
|
||||||
self._processCfg()
|
self._processCfg()
|
||||||
if self._testonly:
|
if self._testonly:
|
||||||
|
|||||||
Reference in New Issue
Block a user