WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-api

[Xen-API] [PATCH 2 of 2] [CA-43971]: Remove code from xapi that generate

To: xen-api@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-API] [PATCH 2 of 2] [CA-43971]: Remove code from xapi that generates pool secret if it's
From: <magnus.therning@xxxxxxxxxxxxx>
Date: Thu, 9 Sep 2010 14:16:02 +0100
Delivery-date: Thu, 09 Sep 2010 06:19:55 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <patchbomb.1284038160@xxxxxxxxxxxxxxxxxxxxxx>
List-help: <mailto:xen-api-request@lists.xensource.com?subject=help>
List-id: Discussion of API issues surrounding Xen <xen-api.lists.xensource.com>
List-post: <mailto:xen-api@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-api>, <mailto:xen-api-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-api>, <mailto:xen-api-request@lists.xensource.com?subject=unsubscribe>
References: <patchbomb.1284038160@xxxxxxxxxxxxxxxxxxxxxx>
Sender: xen-api-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mercurial-patchbomb/1.6.3
 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
<Prev in Thread] Current Thread [Next in Thread>