From c91cc53e73ab2d0d0bc4fd96cf579cf88ef297b1 Mon Sep 17 00:00:00 2001 From: Anael Beutot Date: Wed, 28 Nov 2012 11:56:54 +0100 Subject: [PATCH] vnc: handle case where tag vncport in invalid --- cccli/commands/vnc.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/cccli/commands/vnc.py b/cccli/commands/vnc.py index e82a113..eb779c1 100644 --- a/cccli/commands/vnc.py +++ b/cccli/commands/vnc.py @@ -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: -- GitLab