From cab79e3a245e58e552708bff9049972e91df0f55 Mon Sep 17 00:00:00 2001 From: Jip-Hop <2871973+Jip-Hop@users.noreply.github.com> Date: Thu, 24 Aug 2023 10:03:48 +0200 Subject: [PATCH] Fallback to bullseye --- jlmkr.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/jlmkr.py b/jlmkr.py index 5ee660e..94fb25a 100755 --- a/jlmkr.py +++ b/jlmkr.py @@ -39,7 +39,7 @@ IT COMES WITHOUT WARRANTY AND IS NOT SUPPORTED BY IXSYSTEMS.{NORMAL}""" DESCRIPTION = "Create persistent Linux 'jails' on TrueNAS SCALE, with full access to all files \ via bind mounts, thanks to systemd-nspawn!" -VERSION = '0.0.10' +VERSION = '0.0.11' JAILS_DIR_PATH = 'jails' JAIL_CONFIG_NAME = 'config' @@ -625,7 +625,10 @@ def create_jail(jail_name, distro='debian', release='bullseye'): if agree('Show the man page for systemd-nspawn?', 'n'): subprocess.run(['man', 'systemd-nspawn']) else: - base_os_version = platform.freedesktop_os_release().get('VERSION_CODENAME', release) + try: + base_os_version = platform.freedesktop_os_release().get('VERSION_CODENAME', release) + except AttributeError: + base_os_version = release print(dedent(f""" You may read the systemd-nspawn manual online: https://manpages.debian.org/{base_os_version}/systemd-container/systemd-nspawn.1.en.html"""))