Simplify assertion

This commit is contained in:
Eelco Dolstra 2014-04-16 01:08:14 +02:00
parent eda854d50f
commit 2fc520d699

View File

@ -631,8 +631,7 @@ in
config = {
assertions = mapAttrsToList (name: service: {
assertion = !hasAttr "Type" service.serviceConfig || service.serviceConfig.Type != "oneshot"
|| !hasAttr "Restart" service.serviceConfig || service.serviceConfig.Restart == "no";
assertion = service.serviceConfig.Type or "" == "oneshot" -> service.serviceConfig.Restart or "no" == "no";
message = "${name}: Type=oneshot services must have Restart=no";
}) cfg.services;