Refactor set_hostname() (#3009)

This commit is contained in:
codefiles 2024-12-07 16:57:31 -05:00 committed by GitHub
parent 3400991c9b
commit 8f2bf2b737
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 1 additions and 2 deletions

View File

@ -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 = ''