[fix] Let's not redefine the value for the 'service' var ...

This commit is contained in:
Alexandre Aubin 2020-07-24 00:52:46 +02:00 committed by GitHub
parent 8911499bf3
commit 1a2f26dc34
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -97,8 +97,8 @@ def service_add(name, description=None, log=None, log_type=None, test_status=Non
service["test_status"] = test_status
else:
# Try to get the description from systemd service
_, service = _get_service_information_from_systemd(name)
type_ = service.get("Type") if service is not None else ""
_, systemd_info = _get_service_information_from_systemd(name)
type_ = systemd_info.get("Type") if systemd_info is not None else ""
if type_ == "oneshot":
logger.warning("/!\\ Packagers! Please provide a --test_status when adding oneshot-type services in Yunohost, such that it has a reliable way to check if the service is running or not.")