We now distinguish between "calling pool_join on self" and "calling pool_join
when already in a pool".

Signed-off-by: Rok Strnisa <[email protected]>


 ocaml/xapi/xapi_pool.ml |  6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)


# HG changeset patch
# User Rok Strnisa <[email protected]>
# Date 1284039389 -3600
# Node ID e9c008745a6972f3b5d632e930b16901849b5b6e
# Parent  a2f79559fae447eb48216fe54747e127f66f98c3
CA-25812: OEM Dell: Error message should be clearer during pool-join command. --- FIXED.

We now distinguish between "calling pool_join on self" and "calling pool_join
when already in a pool".

Signed-off-by: Rok Strnisa <[email protected]>

diff --git a/ocaml/xapi/xapi_pool.ml b/ocaml/xapi/xapi_pool.ml
--- a/ocaml/xapi/xapi_pool.ml
+++ b/ocaml/xapi/xapi_pool.ml
@@ -218,7 +218,11 @@ let pre_join_checks ~__context ~rpc ~ses
 		let master_uuid = Client.Host.get_uuid rpc session_id master in
 		let my_uuid = Db.Host.get_uuid ~__context ~self:(Helpers.get_localhost ~__context) in
 		if master_uuid = my_uuid then
-			raise (Api_errors.Server_error(Api_errors.operation_not_allowed, ["Host cannot become slave of itself"])) in
+		let error_msg =
+			if 1 < List.length (Db.Host.get_all ~__context)
+			then "Host is already part of a pool"
+			else "Host cannot become slave of itself" in
+			raise (Api_errors.Server_error(Api_errors.operation_not_allowed, [error_msg])) in
 
 	let assert_homogeneous_vswitch_configuration () =
 		match Netdev.network.Netdev.kind with
_______________________________________________
xen-api mailing list
[email protected]
http://lists.xensource.com/mailman/listinfo/xen-api

Reply via email to