[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Xen-API] [PATCH 2 of 2] [CA-43971]: Remove code from xapi that generates pool secret if it's
ocaml/xapi/helpers.ml | 15 ++++++--------- 1 files changed, 6 insertions(+), 9 deletions(-) # HG changeset patch # User Magnus Therning <magnus.therning@xxxxxxxxxx> # Date 1284037730 -3600 # Node ID 2b60fef169e009d4be333be45370a684acbda1ad # Parent 27492274f55c542306d562e3e74abf8b78f4e055 [CA-43971]: Remove code from xapi that generates pool secret if it's not there. Signed-off-by: Magnus Therning <magnus.therning@xxxxxxxxxx> diff -r 27492274f55c -r 2b60fef169e0 ocaml/xapi/helpers.ml --- a/ocaml/xapi/helpers.ml +++ b/ocaml/xapi/helpers.ml @@ -465,16 +465,13 @@ let field_ops = List.map (fun r->do_lookup r l) vdi_refs in List.fold_right (fun m acc -> match m with None -> acc | Some x -> x :: acc) field_ops [] -(* Read pool secret if there, otherwise create a new one *) +(* Read pool secret if there is one *) +exception Missing_pool_secret + let get_pool_secret () = - if (try (Unix.access pool_secret_path [Unix.F_OK]; true) with _ -> false) then - pool_secret := Unixext.read_whole_file_to_string pool_secret_path - else - begin - let mk_rand_string () = Uuid.to_string (Uuid.make_uuid()) in - pool_secret := (mk_rand_string())^"/"^(mk_rand_string())^"/"^(mk_rand_string()); - Unixext.write_string_to_file pool_secret_path !pool_secret - end + if (try (Unix.access pool_secret_path [Unix.F_OK]; true) with _ -> false) + then pool_secret := Unixext.read_whole_file_to_string pool_secret_path + else raise Missing_pool_secret (* Checks if an SR exists, returning an SR ref option (None if it is missing) *) let check_sr_exists ~__context ~self = _______________________________________________ xen-api mailing list xen-api@xxxxxxxxxxxxxxxxxxx http://lists.xensource.com/mailman/listinfo/xen-api
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |