Skip to content

Commit 00c9980

Browse files
committed
Fix exception on unknown label when creating a VM
get_label() already raises QubesLabelNotFoundError, do not convert it to a generic one.
1 parent 107cc6f commit 00c9980

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

qubes/api/admin.py

+2-4
Original file line numberDiff line numberDiff line change
@@ -1216,10 +1216,8 @@ async def _vm_create(
12161216
self.enforce(not untrusted_value.isdigit())
12171217
allowed_chars = string.ascii_letters + string.digits + "-_."
12181218
self.enforce(all(c in allowed_chars for c in untrusted_value))
1219-
try:
1220-
kwargs["label"] = self.app.get_label(untrusted_value)
1221-
except KeyError:
1222-
raise qubes.exc.QubesValueError
1219+
# this may raise QubesLabelNotFoundError
1220+
kwargs["label"] = self.app.get_label(untrusted_value)
12231221

12241222
elif untrusted_key == "pool" and allow_pool:
12251223
if pool is not None:

0 commit comments

Comments
 (0)