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

-12
View File
@@ -33,8 +33,6 @@ def parse_arguments():
subparsers = parser.add_subparsers(dest='subcommand', help='Sub command')
subparsers.add_parser('setup', help='Configure repro')
subparsers.add_parser('enable', help='Enable repro service')
subparsers.add_parser('disable', help='Disable repro service')
return parser.parse_args()
@@ -61,16 +59,6 @@ def subcommand_setup(_):
action_utils.webserver_enable('repro-plinth')
def subcommand_enable(_):
"""Start service."""
action_utils.service_enable('repro')
def subcommand_disable(_):
"""Stop service."""
action_utils.service_disable('repro')
def main():
"""Parse arguments and perform all duties."""
arguments = parse_arguments()