Skip to content

Commit

Permalink
virt-install: Tell user where to find anaconda logs
Browse files Browse the repository at this point in the history
People keep not realizing they exist, so let's print
a message about it.
  • Loading branch information
cgwalters authored and jlebon committed Apr 25, 2019
1 parent b4f38d9 commit eb3f85f
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
12 changes: 12 additions & 0 deletions src/gf-anaconda-cleanup
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,18 @@ coreos_gf_run "${src}"
coreos_gf set-label /dev/sda2 boot
coreos_gf_run_mount "${src}"

fb=/boot/ignition.firstboot
exists=$(coreos_gf exists "${fb}")
if [ "${exists}" = false ]; then
cat << EOF
---------
error: Couldn't find ${fb} - most likely Anaconda failed."
error: If 9pfs is available, you can find logs in: tmp/build/tmp/anaconda"
---------
EOF
exit 1
fi

# Remove some things written by anaconda; eventually
# we want to reset /etc except we also need /etc/fstab right now e.g.
for x in "/etc/sysconfig/anaconda" "/etc/resolv.conf" "/etc/systemd/system/default.target"; do
Expand Down
5 changes: 4 additions & 1 deletion src/virt-install
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,10 @@ def get_libvirt_smp_arg():

def run(fn, argv, **kwargs):
print("cmd: {}".format(subprocess.list2cmdline(argv)))
return fn(argv, **kwargs)
try:
return fn(argv, **kwargs)
except subprocess.CalledProcessError as e:
raise SystemExit(f"{e}")

def run_sync_verbose(argv, **kwargs):
run(subprocess.check_call, argv, **kwargs)
Expand Down

0 comments on commit eb3f85f

Please sign in to comment.