Config file multiline formatting
This commit is contained in:
parent
00e98ac07d
commit
ed7a883f63
30
jlmkr.py
30
jlmkr.py
|
@ -1010,17 +1010,25 @@ def create_jail(jail_name, distro="debian", release="bookworm"):
|
||||||
"--inaccessible=/sys/module/apparmor",
|
"--inaccessible=/sys/module/apparmor",
|
||||||
]
|
]
|
||||||
|
|
||||||
config = cleandoc(
|
systemd_nspawn_user_args_multiline = "\n\t".join(
|
||||||
f"""
|
shlex.split(systemd_nspawn_user_args)
|
||||||
startup={startup}
|
)
|
||||||
docker_compatible={docker_compatible}
|
systemd_run_default_args_multiline = "\n\t".join(systemd_run_default_args)
|
||||||
gpu_passthrough_intel={gpu_passthrough_intel}
|
systemd_nspawn_default_args_multiline = "\n\t".join(systemd_nspawn_default_args)
|
||||||
gpu_passthrough_nvidia={gpu_passthrough_nvidia}
|
|
||||||
systemd_nspawn_user_args={systemd_nspawn_user_args}
|
config = "\n".join(
|
||||||
# You generally will not need to change the options below
|
[
|
||||||
systemd_run_default_args={' '.join(systemd_run_default_args)}
|
f"startup={startup}",
|
||||||
systemd_nspawn_default_args={' '.join(systemd_nspawn_default_args)}
|
f"docker_compatible={docker_compatible}",
|
||||||
"""
|
f"gpu_passthrough_intel={gpu_passthrough_intel}",
|
||||||
|
f"gpu_passthrough_nvidia={gpu_passthrough_nvidia}",
|
||||||
|
f"systemd_nspawn_user_args={systemd_nspawn_user_args_multiline}",
|
||||||
|
"",
|
||||||
|
"# You generally will not need to change the options below",
|
||||||
|
f"systemd_run_default_args={systemd_run_default_args_multiline}",
|
||||||
|
"",
|
||||||
|
f"systemd_nspawn_default_args={systemd_nspawn_default_args_multiline}",
|
||||||
|
]
|
||||||
)
|
)
|
||||||
|
|
||||||
print(config, file=open(jail_config_path, "w"))
|
print(config, file=open(jail_config_path, "w"))
|
||||||
|
|
Loading…
Reference in New Issue