fix systemd bug
Change-Id: I8a3f1eddba9525589757d4612a5060267ea0c5db
This commit is contained in:
parent
ee31f8fb45
commit
f6868da3b9
@ -169,7 +169,7 @@ class Parameter(Accessible):
|
|||||||
OrType(FloatRange(0), EnumType(always=0, never=999999999, default=-1)),
|
OrType(FloatRange(0), EnumType(always=0, never=999999999, default=-1)),
|
||||||
export=False, default=-1)
|
export=False, default=-1)
|
||||||
influences = Property(
|
influences = Property(
|
||||||
'optional hint about effected parameters', ArrayOf(StringType()),
|
'optional hint about affected parameters', ArrayOf(StringType()),
|
||||||
extname='influences', export=True, mandatory=False, default=[])
|
extname='influences', export=True, mandatory=False, default=[])
|
||||||
|
|
||||||
# used on the instance copy only
|
# used on the instance copy only
|
||||||
@ -367,7 +367,7 @@ class Command(Accessible):
|
|||||||
'datatype of the result from the command, or None', NoneOr(DataTypeType()),
|
'datatype of the result from the command, or None', NoneOr(DataTypeType()),
|
||||||
export=False, mandatory=True)
|
export=False, mandatory=True)
|
||||||
influences = Property(
|
influences = Property(
|
||||||
'optional hint about effected parameters', ArrayOf(StringType()),
|
'optional hint about affected parameters', ArrayOf(StringType()),
|
||||||
extname='influences', export=True, mandatory=False, default=[])
|
extname='influences', export=True, mandatory=False, default=[])
|
||||||
|
|
||||||
func = None
|
func = None
|
||||||
|
@ -45,6 +45,7 @@ except ImportError:
|
|||||||
DaemonContext = None
|
DaemonContext = None
|
||||||
|
|
||||||
try:
|
try:
|
||||||
|
# pylint: disable=unused-import
|
||||||
import systemd.daemon
|
import systemd.daemon
|
||||||
except ImportError:
|
except ImportError:
|
||||||
systemd = None
|
systemd = None
|
||||||
@ -132,8 +133,12 @@ class Server:
|
|||||||
while self._restart:
|
while self._restart:
|
||||||
self._restart = False
|
self._restart = False
|
||||||
try:
|
try:
|
||||||
if systemd:
|
# TODO: make systemd notifications configurable
|
||||||
|
if systemd: # pylint: disable=used-before-assignment
|
||||||
systemd.daemon.notify("STATUS=initializing")
|
systemd.daemon.notify("STATUS=initializing")
|
||||||
|
except Exception:
|
||||||
|
systemd = None # pylint: disable=redefined-outer-name
|
||||||
|
try:
|
||||||
self._processCfg()
|
self._processCfg()
|
||||||
if self._testonly:
|
if self._testonly:
|
||||||
return
|
return
|
||||||
|
Loading…
x
Reference in New Issue
Block a user