Skip to content

Commit e5d641c

Browse files
authored
Merge pull request #175 from arighi/chroot-handle-undefined-release
virtme-ng: handle undefined release with --root
2 parents 7ca90bc + f79d5c3 commit e5d641c

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

virtme_ng/run.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -548,9 +548,11 @@ def create_root(destdir, arch, release):
548548
.decode(sys.stdout.encoding)
549549
.rstrip()
550550
)
551-
except CalledProcessError as e:
552-
print("Try specifying an Ubuntu release with --root-release")
553-
raise e
551+
if release == "n/a":
552+
raise ValueError("unknown release")
553+
except (CalledProcessError, ValueError):
554+
print("Unknown release, try specifying an Ubuntu release with --root-release")
555+
sys.exit(1)
554556
url = (
555557
"https://cloud-images.ubuntu.com/"
556558
+ f"{release}/current/{release}-server-cloudimg-{arch}-root.tar.xz"

0 commit comments

Comments
 (0)