mirror of
https://github.com/YunoHost/yunohost.git
synced 2024-09-03 20:06:10 +02:00
Need to explicitly convert info from dbusthingy to str :/
This commit is contained in:
parent
5c8c07b8c9
commit
086db7a94b
2 changed files with 10 additions and 2 deletions
|
@ -78,7 +78,7 @@ def service_add(name, description=None, log=None, log_type=None, test_status=Non
|
||||||
if not description:
|
if not description:
|
||||||
# Try to get the description from systemd service
|
# Try to get the description from systemd service
|
||||||
unit, _ = _get_service_information_from_systemd(name)
|
unit, _ = _get_service_information_from_systemd(name)
|
||||||
description = unit.get("Description", "") if unit is not None else ""
|
description = str(unit.get("Description", "")) if unit is not None else ""
|
||||||
# If the service does not yet exists or if the description is empty,
|
# If the service does not yet exists or if the description is empty,
|
||||||
# systemd will anyway return foo.service as default value, so we wanna
|
# systemd will anyway return foo.service as default value, so we wanna
|
||||||
# make sure there's actually something here.
|
# make sure there's actually something here.
|
||||||
|
|
|
@ -25,7 +25,11 @@ def clean():
|
||||||
|
|
||||||
if "dummyservice" in services:
|
if "dummyservice" in services:
|
||||||
del services["dummyservice"]
|
del services["dummyservice"]
|
||||||
_save_services(services)
|
|
||||||
|
if "networking" in services:
|
||||||
|
del services["networking"]
|
||||||
|
|
||||||
|
_save_services(services)
|
||||||
|
|
||||||
|
|
||||||
def test_service_status_all():
|
def test_service_status_all():
|
||||||
|
@ -60,6 +64,10 @@ def test_service_add():
|
||||||
service_add("dummyservice", description="A dummy service to run tests")
|
service_add("dummyservice", description="A dummy service to run tests")
|
||||||
assert "dummyservice" in service_status().keys()
|
assert "dummyservice" in service_status().keys()
|
||||||
|
|
||||||
|
def test_service_add_real_service()
|
||||||
|
|
||||||
|
service_add("networking")
|
||||||
|
assert "networking" in service_status().keys()
|
||||||
|
|
||||||
def test_service_remove():
|
def test_service_remove():
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue