summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordd <dd@wx.tnyzeq.icu>2024-10-10 19:30:50 +0200
committerdd <dd@wx.tnyzeq.icu>2024-10-10 19:30:50 +0200
commita6b2c19b56cd3f690959447e08d52a3147f4c445 (patch)
tree07b75a72915d9e853580633339c36acb0986a50b
parentfb39083b74d2b2a5b4c330c7223031d00c9e289e (diff)
downloadvyos-jenkins-a6b2c19b56cd3f690959447e08d52a3147f4c445.tar.gz
vyos-jenkins-a6b2c19b56cd3f690959447e08d52a3147f4c445.zip
improved circinus debranding
-rw-r--r--new/lib/debranding.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/new/lib/debranding.py b/new/lib/debranding.py
index b7cdb8d..86d2f82 100644
--- a/new/lib/debranding.py
+++ b/new/lib/debranding.py
@@ -17,6 +17,7 @@ class Debranding:
keep_branding = None
remove_branding = None
alternative_name = None
+ logged = False
def __init__(self):
self.cache = Cache(os.path.join(data_dir, "debranding-cache.json"), dict, {})
@@ -50,6 +51,11 @@ class Debranding:
("VyOS", alternative_name),
])
+ motd_path = os.path.join(root_dir, "data/templates/login/motd_vyos_nonproduction.j2")
+ if os.path.exists(motd_path):
+ with open(motd_path, "w") as file:
+ file.truncate()
+
login_banner_path = os.path.join(root_dir, "src/conf_mode/system_login_banner.py")
self.replace_patterns_in_file(login_banner_path, [
("Welcome to VyOS", "Welcome to %s" % alternative_name),
@@ -177,6 +183,10 @@ class Debranding:
self.cache.set("alternative_name", self.alternative_name)
def log_settings(self):
+ if self.logged:
+ return
+ self.logged = True
+
if not self.is_debranding_enabled():
option = "option" if self.keep_branding else "cached option"
logging.info("Using %s --keep-branding to keep VyOS branding intact" % option)