shlax/shlax/actions/service.py
jpic 984f09d704 Refactor output and call
Each action has its own output from now on.
2020-02-15 01:04:52 +01:00

17 lines
390 B
Python

import asyncio
from .base import Action
class Service(Action):
def __init__(self, *names, state=None):
self.state = state or 'started'
self.names = names
super().__init__()
async def call(self, *args, **kwargs):
return asyncio.gather(*[
self.exec('systemctl', 'start', name, user='root')
for name in self.names
])