1
0
Fork 0

map_param now adds newlines to the lines it generates

Dieser Commit ist enthalten in:
Sebastian Tobie 2023-04-26 18:58:30 +02:00
Ursprung ec82abe3d4
Commit c3404200a9
4 geänderte Dateien mit 5 neuen und 5 gelöschten Zeilen

Datei anzeigen

@ -250,9 +250,9 @@ class SystemdUnitModule(AnsibleModule):
if self.params[param] is not None: if self.params[param] is not None:
params = self.params[param] params = self.params[param]
if isinstance(params, list): if isinstance(params, list):
output.extend(("{}={}".format(key, p) for p in params)) output.extend(("{}={}\n".format(key, p) for p in params))
else: else:
output.append("{}={}".format(key, self.params[param])) output.append("{}={}\n".format(key, self.params[param]))
return output return output
def unitfile_gen(self): def unitfile_gen(self):

Datei anzeigen

@ -52,7 +52,7 @@ class Module(SystemdUnitModule): # type: ignore
type="Type", type="Type",
kind="Kind", kind="Kind",
) )
return "[Match]\n" + "\n".join(options) return "[Match]\n" + "".join(options)
def link(self) -> str: def link(self) -> str:
options = [] options = []

Datei anzeigen

@ -48,7 +48,7 @@ class Module(SystemdUnitModule, SystemdReloadMixin): # type: ignore
def socket(self): def socket(self):
section = "[Socket]\n" section = "[Socket]\n"
section += "\n".join( section += "".join(
self.map_param( self.map_param(
stream="ListenStream", stream="ListenStream",
datagram="ListenDatagram", datagram="ListenDatagram",

Datei anzeigen

@ -60,7 +60,7 @@ class Module(SystemdUnitModule, SystemdReloadMixin):
def service(self): def service(self):
section = "[Service]\n" section = "[Service]\n"
section += "\n".join( section += "".join(
self.map_param( self.map_param(
type="Type", type="Type",
pre="ExecStartPre", pre="ExecStartPre",