Skip to content

Commit

Permalink
Merge pull request #2885 from gaborigloi/remove_client_records
Browse files Browse the repository at this point in the history
Remove empty client_records directory
  • Loading branch information
thomassa committed Jan 20, 2017
2 parents 63fffb0 + 5544a4d commit 2dfaae4
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 12 deletions.
1 change: 0 additions & 1 deletion ocaml/OMakefile
Expand Up @@ -7,7 +7,6 @@ OCAMLPACKS = stdext uuid gzip
.SUBDIRS: \
ptoken \
xe-cli \
client_records \
idl \
util \
xapi \
Expand Down
6 changes: 0 additions & 6 deletions ocaml/client_records/OMakefile

This file was deleted.

2 changes: 1 addition & 1 deletion ocaml/perftest/OMakefile
@@ -1,5 +1,5 @@
OCAML_LIBS = ../util/version ../xapi-consts/xapi-consts ../xapi-types/xapi-types ../xapi-client/xapi-client
OCAMLINCLUDES = ../client_records ../idl ../xapi-consts ../xapi-client ../xapi-types
OCAMLINCLUDES = ../idl ../xapi-consts ../xapi-client ../xapi-types
OCAMLPACKS = xml-light2 stdext stunnel http-svr xcp rpclib uuid xcp-inventory

PERFTEST_FILES = scenario perfutil createVM createpool testtypes perftest tests ../xapi/xapi_inventory perfdebug
Expand Down
8 changes: 4 additions & 4 deletions ocaml/xapi/cli_operations.ml
Expand Up @@ -447,7 +447,7 @@ let filter_records_on_set_param records (k,v) s =
let field = field_lookup record.fields s in
let get_set = match field.get_set with
| Some x -> x
| None -> (failwith (Printf.sprintf "Client_records broken (field %s)" s))
| None -> (failwith (Printf.sprintf "Records broken (field %s)" s))
in
try
let set = get_set () in
Expand All @@ -469,7 +469,7 @@ let filter_records_on_map_param records (k,v) s =
let field = field_lookup record.fields s in
let get_map = match field.get_map with
| Some x -> x
| None -> failwith (Printf.sprintf "Client_records broken (field %s)" s)
| None -> failwith (Printf.sprintf "Records broken (field %s)" s)
in
try
let map = get_map () in
Expand Down Expand Up @@ -656,14 +656,14 @@ let make_param_funs getall getallrecs getbyuuid record class_name def_filters de
let key = String.sub k (n + 1) (String.length k - n - 1) in
let get_map = match field.get_map with
| Some x -> x
| None -> failwith (Printf.sprintf "Broken Client_records (field %s)" s)
| None -> failwith (Printf.sprintf "Broken Records (field %s)" s)
in begin
(* If set_in_map is present, use it instead of using remove_from_map followed by add_to_map. *)
match field.set_in_map with
| Some set_in_map -> set_in_map key v
| None ->
let add_to_map = match field.add_to_map with Some f -> f | None -> failwith ("Map field '"^s^"' is read-only.") in
let remove_from_map = match field.remove_from_map with Some f -> f | None -> failwith (Printf.sprintf "Client_records broken (field %s)" s) in
let remove_from_map = match field.remove_from_map with Some f -> f | None -> failwith (Printf.sprintf "Records broken (field %s)" s) in
let map = get_map () in
if List.mem_assoc key map then remove_from_map key;
add_to_map key v
Expand Down

0 comments on commit 2dfaae4

Please sign in to comment.