def restart(service): """Restarts the given service""" if service == 'all': return [Service(s).restart() for s in Service.SERVICE_LIST] service = Service(service) s.info(f"Restarting $[{service.name}]") service.restart()