more consisten quoting

This commit is contained in:
Dima Gerasimov 2020-04-12 15:56:24 +01:00
parent af24c99157
commit 3327e40f09

View file

@ -37,8 +37,12 @@ def setup(args):
server_bin = Path(__file__).parent.joinpath('grasp_server.py').absolute()
template = args.template.replace('%', '%%').replace('\n', r'\n') # escape for systemd...
template = shlex.quote(template)
extra_args = f'--port {args.port} --path {args.path} --template {template}'
args = [
'--port', args.port,
'--path', args.path,
'--template', template,
]
extra_args = ' '.join(map(shlex.quote, args))
with out.open('w') as fo:
fo.write(SYSTEMD_CONFIG.format(