Skip to content

Commit 4ebe29c

Browse files
authored
Merge pull request #170 from rbmarliere/fix_create_root
Add hint when trying to create root filesystem outside a Debian host
2 parents 9e72d75 + 97dd475 commit 4ebe29c

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

virtme_ng/run.py

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -542,11 +542,15 @@ def create_root(destdir, arch, release):
542542
# Use Ubuntu's cloud images to create a rootfs, these images are fairly
543543
# small and they provide a nice environment to test kernels.
544544
if release is None:
545-
release = (
546-
check_output("lsb_release -s -c", shell=True)
547-
.decode(sys.stdout.encoding)
548-
.rstrip()
549-
)
545+
try:
546+
release = (
547+
check_output("lsb_release -s -c", shell=True)
548+
.decode(sys.stdout.encoding)
549+
.rstrip()
550+
)
551+
except CalledProcessError as e:
552+
print("Try specifying an Ubuntu release with --root-release")
553+
raise e
550554
url = (
551555
"https://cloud-images.ubuntu.com/"
552556
+ f"{release}/current/{release}-server-cloudimg-{arch}-root.tar.xz"

0 commit comments

Comments
 (0)