From: Jon Ludlam Date: Tue, 12 Oct 2010 11:12:54 +0000 (+0100) Subject: This fixes tapctl.list when there are no arguments set X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=9f3b466aa07e531e397fd04a546b972056648d0e;p=xcp%2Fxen-api-libs.git This fixes tapctl.list when there are no arguments set Signed-off-by: Jon Ludlam --- diff --git a/tapctl/tapctl.ml b/tapctl/tapctl.ml index 845cfec..bd8de51 100644 --- a/tapctl/tapctl.ml +++ b/tapctl/tapctl.ml @@ -315,10 +315,12 @@ let list ?t ctx = None) fields in let args = - match String.split ':' (List.assoc "args" assoc) with - | ty::arguments -> - Some (ty,String.concat ":" arguments) - | _ -> None + try + match String.split ':' (List.assoc "args" assoc) with + | ty::arguments -> + Some (ty,String.concat ":" arguments) + | _ -> None + with _ -> None in Some ({tapdisk_pid=int_of_string (List.assoc "pid" assoc); minor=int_of_string (List.assoc "minor" assoc)},(List.assoc "state" assoc),args) with _ -> None) lines