install: use pathlib.Path.write_bytes construct instead of open + write

Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
This commit is contained in:
Olivier Gayot 2024-03-25 17:41:07 +01:00
parent 092cbf14df
commit 2d8a1ea9b3
1 changed files with 1 additions and 2 deletions

View File

@ -752,8 +752,7 @@ class InstallController(SubiquityController):
else:
apt_conf_contents += uu_apt_conf_update_security
apt_conf_path = Path(aptdir) / "zzzz-temp-installer-unattended-upgrade"
with open(apt_conf_path, "wb") as apt_conf:
apt_conf.write(apt_conf_contents)
apt_conf_path.write_bytes(apt_conf_contents)
try:
self.unattended_upgrades_ctx = context
self.unattended_upgrades_cmd = await start_curtin_command(