1
0
Fork 0

eased the redability of the installable decorator

Dieser Commit ist enthalten in:
Sebastian Tobie 2023-04-23 09:30:43 +02:00
Ursprung 3888436ad4
Commit e94dbec9f4
1 geänderte Dateien mit 4 neuen und 1 gelöschten Zeilen

Datei anzeigen

@ -323,6 +323,8 @@ _INSTALL_MAPPING = dict(
def installable(_class: Type[SystemdUnitModule]): def installable(_class: Type[SystemdUnitModule]):
"""adds the required arguments to the spec and adds the install method for the unit method""" """adds the required arguments to the spec and adds the install method for the unit method"""
specs = _class.module_spec
arguments = dict( arguments = dict(
required_by=Types.list(elements=str, help="systemd units that require this mount"), required_by=Types.list(elements=str, help="systemd units that require this mount"),
wanted_by=Types.list( wanted_by=Types.list(
@ -330,7 +332,7 @@ def installable(_class: Type[SystemdUnitModule]):
help="systemd units that want the mount, but not explicitly require it. Commonly used for target if not service explicitly require it.", help="systemd units that want the mount, but not explicitly require it. Commonly used for target if not service explicitly require it.",
), ),
) )
_class.module_spec["argument_spec"].update(arguments) specs["argument_spec"].update(arguments)
def install(self: SystemdUnitModule) -> str: def install(self: SystemdUnitModule) -> str:
output = "[Install]\n" output = "[Install]\n"
@ -341,4 +343,5 @@ def installable(_class: Type[SystemdUnitModule]):
return output return output
_class.install = install _class.install = install
_class.module_spec = specs
return _class return _class