]> xenbits.xensource.com Git - xcp/xen-api-libs.git/commitdiff
This fixes tapctl.list when there are no arguments set
authorJon Ludlam <Jonathan.Ludlam@eu.citrix.com>
Tue, 12 Oct 2010 11:12:54 +0000 (12:12 +0100)
committerJon Ludlam <Jonathan.Ludlam@eu.citrix.com>
Tue, 12 Oct 2010 11:12:54 +0000 (12:12 +0100)
Signed-off-by: Jon Ludlam <Jonathan.Ludlam@eu.citrix.com>
tapctl/tapctl.ml

index 845cfece93208136f3c4581b5712161833184268..bd8de51ae78463bb1d4b1019acda2a41f52b9bd8 100644 (file)
@@ -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