Service object to handle services on a system-level

The Service object now offers handling services on a system level,
and gathering information whether it's enabled or running.
New methods: enable, disable, is_enabled, is_running;

For this it needs the correct (system-level) service name.
All of the methods can be overridden/customized.

This changes all modules to the new Service object and deletes
action scripts that are not required anymore.
This commit is contained in:
fonfon authored and James Valleroy committed 2016-05-11 18:19:27 -04:00
1 parent 9fe49f881f
commit a9528c56d9
30 files changed
+243 -629

No files matched your search

+7 -2
View File
@@ -20,6 +20,7 @@ Plinth module to configure ownCloud
"""
from django.utils.translation import ugettext_lazy as _
from functools import partial
from plinth import actions
from plinth import action_utils
@@ -57,8 +58,8 @@ def init():
global service
service = service_module.Service(
'owncloud', title, ['http', 'https'], is_external=True,
enabled=is_enabled())
'owncloud', title, ports=['http', 'https'], is_external=True,
is_enabled=is_enabled, enable=_enable, disable=_disable)
def setup(helper, old_version=None):
@@ -98,3 +99,7 @@ def diagnose():
'https://{host}/owncloud', extra_options=['--no-check-certificate']))
return results
_enable = partial(enable, True)
_disable = partial(enable, False)