forked from Mirror/pmbootstrap
pmb.netboot: Use NonBugError for nonexistent rootfs code path (MR 2540)
We fully expect to reach this code path within normal use of pmbootstrap. It's not a bug if we get here. As such, use NonBugError to indicate that and clean up the output.
This commit is contained in:
parent
d01f6b9079
commit
3ef25e1467
1 changed files with 2 additions and 1 deletions
|
@ -2,6 +2,7 @@
|
||||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
from pmb.core.context import get_context
|
from pmb.core.context import get_context
|
||||||
from pmb.helpers import logging
|
from pmb.helpers import logging
|
||||||
|
from pmb.helpers.exceptions import NonBugError
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
import socket
|
import socket
|
||||||
import time
|
import time
|
||||||
|
@ -24,7 +25,7 @@ def start_nbd_server(device: str, replace: bool, ip: str = "172.16.42.2", port:
|
||||||
if not (chroot / rootfs_path).exists() or replace:
|
if not (chroot / rootfs_path).exists() or replace:
|
||||||
rootfs_path2 = Path("/home/pmos/rootfs") / f"{device}.img"
|
rootfs_path2 = Path("/home/pmos/rootfs") / f"{device}.img"
|
||||||
if not (chroot / rootfs_path2).exists():
|
if not (chroot / rootfs_path2).exists():
|
||||||
raise RuntimeError(
|
raise NonBugError(
|
||||||
"The rootfs has not been generated yet, please run 'pmbootstrap install' first."
|
"The rootfs has not been generated yet, please run 'pmbootstrap install' first."
|
||||||
)
|
)
|
||||||
if replace and not pmb.helpers.cli.confirm(
|
if replace and not pmb.helpers.cli.confirm(
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue