Merge pull request #1619 from blackboxsw/preserve-cloud-init-logs-in-target
cloud-init: preserve ephemeral cloud-init logs in target to aid in debug
This commit is contained in:
commit
84e79faa41
|
@ -100,6 +100,18 @@ class ShutdownController(SubiquityController):
|
||||||
if self.opts.dry_run:
|
if self.opts.dry_run:
|
||||||
os.makedirs(target_logs, exist_ok=True)
|
os.makedirs(target_logs, exist_ok=True)
|
||||||
else:
|
else:
|
||||||
|
# Preserve ephemeral boot cloud-init logs if applicable
|
||||||
|
cloudinit_logs = [
|
||||||
|
cloudinit_log
|
||||||
|
for cloudinit_log in (
|
||||||
|
"/var/log/cloud-init.log",
|
||||||
|
"/var/log/cloud-init-output.log"
|
||||||
|
)
|
||||||
|
if os.path.exists(cloudinit_log)
|
||||||
|
]
|
||||||
|
if cloudinit_logs:
|
||||||
|
await arun_command(
|
||||||
|
['cp', '-a'] + cloudinit_logs + ['/var/log/installer'])
|
||||||
await arun_command(
|
await arun_command(
|
||||||
['cp', '-aT', '/var/log/installer', target_logs])
|
['cp', '-aT', '/var/log/installer', target_logs])
|
||||||
# Close the permissions from group writes on the target.
|
# Close the permissions from group writes on the target.
|
||||||
|
|
Loading…
Reference in New Issue