From 8f2bf2b7374978e24dcd367b0af0cca48a86d4e7 Mon Sep 17 00:00:00 2001 From: codefiles <11915375+codefiles@users.noreply.github.com> Date: Sat, 7 Dec 2024 16:57:31 -0500 Subject: [PATCH] Refactor set_hostname() (#3009) --- archinstall/lib/installer.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/archinstall/lib/installer.py b/archinstall/lib/installer.py index 1da73abc..2a3b1e5a 100644 --- a/archinstall/lib/installer.py +++ b/archinstall/lib/installer.py @@ -526,8 +526,7 @@ class Installer: fp.write(f'{entry}\n') def set_hostname(self, hostname: str) -> None: - with open(f'{self.target}/etc/hostname', 'w') as fh: - fh.write(hostname + '\n') + (self.target / 'etc/hostname').write_text(hostname + '\n') def set_locale(self, locale_config: LocaleConfiguration) -> bool: modifier = ''