No os.system()

This commit is contained in:
Jip-Hop 2023-08-15 14:01:05 +02:00
parent 6bab739821
commit 35e0d7c2db
1 changed files with 2 additions and 2 deletions

View File

@ -586,7 +586,7 @@ def create_jail(jail_name, distro='debian', release='bullseye'):
""")) """))
if agree('Show the man page for systemd-nspawn?', 'n'): if agree('Show the man page for systemd-nspawn?', 'n'):
os.system("man systemd-nspawn") subprocess.run(['man', 'systemd-nspawn'])
else: else:
base_os_version = platform.freedesktop_os_release().get('VERSION_CODENAME', release) base_os_version = platform.freedesktop_os_release().get('VERSION_CODENAME', release)
print(dedent(f""" print(dedent(f"""
@ -803,7 +803,7 @@ def edit_jail(jail_name):
eprint(f"Unable to edit config file: {jail_config_path}.") eprint(f"Unable to edit config file: {jail_config_path}.")
eprint(f"The {TEXT_EDITOR} text editor is not available.") eprint(f"The {TEXT_EDITOR} text editor is not available.")
else: else:
os.system(f'{TEXT_EDITOR} {get_jail_config_path(jail_name)}') subprocess.run([TEXT_EDITOR, get_jail_config_path(jail_name)])
if jail_is_running(jail_name): if jail_is_running(jail_name):
print("\nRestart the jail for edits to apply (if you made any).") print("\nRestart the jail for edits to apply (if you made any).")