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

+4 -3
View File
@@ -40,10 +40,11 @@ class ConfigurationView(views.ConfigurationView):
modified = False
if old_status['enabled'] != new_status['enabled']:
sub_command = 'enable' if new_status['enabled'] else 'disable'
if new_status['enabled']:
datetime.service.enable()
else:
datetime.service.disable()
modified = True
actions.superuser_run('datetime', [sub_command])
datetime.service.notify_enabled(None, new_status['enabled'])
messages.success(self.request, _('Configuration updated'))
if old_status['time_zone'] != new_status['time_zone'] and \