Skip to content
Snippets Groups Projects
Commit c91cc53e authored by Anael Beutot's avatar Anael Beutot Committed by Sébastien Luttringer
Browse files

vnc: handle case where tag vncport in invalid

parent f060f0bd
No related branches found
No related tags found
No related merge requests found
......@@ -87,7 +87,10 @@ class Command_vnc(TqlCommand):
raise cmdError("No selected object")
for vm in ans["objects"]:
host_id = vm["p"]
dest_port = int(vm["vncport"])
try:
dest_port = int(vm["vncport"])
except ValueError:
raise cmdError('Invalid value for tag vncport')
# check if we have the right to forward on this hypervisor
ans2 = self.rpc.call("list", "id:%s" % host_id, method="forward")
if len(ans2["objects"]) == 0:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment