The callers expect that if vsctl returns no output an empty list will be returned. Instead a list containing the empty string was returned due to the behaviour of Stringext.Strings.split when passed an empty string. Explicitly check for an empty response from vsctl.
Signed-off-by: Ian Campbell <[email protected]> diff -r b180a565573e -r 18f593937240 ocaml/netdev/netdev.ml --- a/ocaml/netdev/netdev.ml Mon Jan 25 10:30:12 2010 +0000 +++ b/ocaml/netdev/netdev.ml Mon Jan 25 13:36:25 2010 +0000 @@ -219,7 +219,9 @@ Unix.access vsctl_script [ Unix.X_OK ]; let output, _ = Forkhelpers.execute_command_get_output vsctl_script args in let stripped = Stringext.String.strip (fun c -> c='\n') output in - Stringext.String.split '\n' stripped + match stripped with + | "" -> [] + | s -> Stringext.String.split '\n' s let add name = ignore(vsctl ["add-br" ; name]) let del name = ignore(vsctl ["del-br" ; name]) _______________________________________________ xen-api mailing list [email protected] http://lists.xensource.com/mailman/listinfo/xen-api
