Skip to content

Commit c1c46ae

Browse files
committed
Refactor set_hostname()
1 parent 19a0d49 commit c1c46ae

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

archinstall/lib/installer.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -526,8 +526,7 @@ def genfstab(self, flags: str = '-pU') -> None:
526526
fp.write(f'{entry}\n')
527527

528528
def set_hostname(self, hostname: str) -> None:
529-
with open(f'{self.target}/etc/hostname', 'w') as fh:
530-
fh.write(hostname + '\n')
529+
(self.target / 'etc/hostname').write_text(hostname + '\n')
531530

532531
def set_locale(self, locale_config: LocaleConfiguration) -> bool:
533532
modifier = ''

0 commit comments

Comments
 (0)