From d89320ea097b5c992c55ff679dde5a28bb22618b Mon Sep 17 00:00:00 2001 From: Natalia Serrano Date: Tue, 22 Oct 2024 10:34:40 +0000 Subject: [PATCH] refs #1015 fix addition of entries to fstab --- installer/ogboot_installer.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/installer/ogboot_installer.py b/installer/ogboot_installer.py index 12099e0..3a6d8f5 100755 --- a/installer/ogboot_installer.py +++ b/installer/ogboot_installer.py @@ -345,9 +345,10 @@ def add_fstab_entries(uid, gid): existing_entries = fstab.readlines() # Check if the entries already exist in /etc/fstab - if all(entry.strip() not in existing_entries for entry in fstab_entries): - with open('/etc/fstab', 'a') as fstab: - fstab.writelines(fstab_entries) + for entry in fstab_entries: + if entry not in existing_entries: + with open('/etc/fstab', 'a') as fstab: + fstab.writelines(entry) logger.info("Entradas aƱadidas a /etc/fstab correctamente.") else: logger.info("Las entradas ya existen en /etc/fstab. No se aƱadieron nuevamente.")