Merge pull request #1952 from ogayot/zzzz-remove
Ensure the zzzz-temp-installer-unattended-upgrade file does not end up on the target system
This commit is contained in:
commit
cdb56a0d9f
|
@ -751,10 +751,9 @@ class InstallController(SubiquityController):
|
|||
apt_conf_contents += uu_apt_conf_update_all
|
||||
else:
|
||||
apt_conf_contents += uu_apt_conf_update_security
|
||||
fname = "zzzz-temp-installer-unattended-upgrade"
|
||||
with open(os.path.join(aptdir, fname), "wb") as apt_conf:
|
||||
apt_conf.write(apt_conf_contents)
|
||||
apt_conf.close()
|
||||
apt_conf_path = Path(aptdir) / "zzzz-temp-installer-unattended-upgrade"
|
||||
apt_conf_path.write_bytes(apt_conf_contents)
|
||||
try:
|
||||
self.unattended_upgrades_ctx = context
|
||||
self.unattended_upgrades_cmd = await start_curtin_command(
|
||||
self.app,
|
||||
|
@ -772,6 +771,8 @@ class InstallController(SubiquityController):
|
|||
except subprocess.CalledProcessError as cpe:
|
||||
log_process_streams(logging.ERROR, cpe, "Unattended upgrades")
|
||||
context.description = f"FAILED to apply {policy} updates"
|
||||
finally:
|
||||
apt_conf_path.unlink()
|
||||
self.unattended_upgrades_cmd = None
|
||||
self.unattended_upgrades_ctx = None
|
||||
|
||||
|
|
Loading…
Reference in New Issue