From 515a74ba11cdab5107b88e8849f721657ee38d0a Mon Sep 17 00:00:00 2001 From: David Duque Date: Tue, 14 Jul 2020 11:51:25 +0100 Subject: [PATCH] Render the lsb_release at flask init time Don't change the index.html file at setup time --- management/daemon.py | 3 +++ management/templates/index.html | 2 +- setup/preflight.sh | 2 -- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/management/daemon.py b/management/daemon.py index 2731bb1..1776303 100755 --- a/management/daemon.py +++ b/management/daemon.py @@ -101,9 +101,12 @@ def index(): utils.fix_boto() # must call prior to importing boto import boto.s3 backup_s3_hosts = [(r.name, r.endpoint) for r in boto.s3.regions()] + lsb=utils.shell("check_output", ["/usr/bin/lsb_release", "-d"]) return render_template('index.html', hostname=env['PRIMARY_HOSTNAME'], + distname=lsb[lsb.find("\t")+1:-1], + storage_root=env['STORAGE_ROOT'], no_users_exist=no_users_exist, diff --git a/management/templates/index.html b/management/templates/index.html index f4fa9a5..82e929e 100644 --- a/management/templates/index.html +++ b/management/templates/index.html @@ -180,7 +180,7 @@
diff --git a/setup/preflight.sh b/setup/preflight.sh index 785ec72..5195269 100644 --- a/setup/preflight.sh +++ b/setup/preflight.sh @@ -18,8 +18,6 @@ if [ "$OS" != "Debian GNU/Linux 10 (buster)" -a "$OS" != "Ubuntu 20.04 LTS" ]; t exit 1 fi -sed -i "s|!!___DIST_TAG___!!|${OS}|g" management/templates/index.html - # Check that we have enough memory. # # /proc/meminfo reports free memory in kibibytes. Our baseline will be 512 MB,