Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
raise ValueError(
"State %s should contain only constant value %r"
% (state.name, state.constant),
state.name,
state.constant,
)
line = "%s=%s" % (
state.name,
state.constant if state.constant is not None else state.type(value),
)
log.debug("Send %r into systemd", line)
try:
return sd_notify(line, unset_environment)
except Exception as e:
if return_exceptions:
log.error("%s", e)
return e
raise