Skip to content

Commit 87e8e06

Browse files
authored
Merge pull request xapi-project#3128 from lindig/pool-join-hnl
CA-259288 provide descriptive reason when raising pool_hosts_not_homogeneous
2 parents 071b65d + 90d0843 commit 87e8e06

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

ocaml/xapi/xapi_pool.ml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -162,14 +162,17 @@ let pre_join_checks ~__context ~rpc ~session_id ~force =
162162
if not (S.equal local_updates remote_updates) then begin
163163
let remote_uuid = Client.Host.get_uuid rpc session_id pool_host in
164164
let diff xs ys = S.diff xs ys |> S.elements |> String.concat "," in
165-
let reason = [remote_uuid] in
165+
let reason =
166+
Printf.sprintf "Updates on local host %s and pool host %s differ"
167+
(Db.Host.get_name_label ~__context ~self:local_host)
168+
(Client.Host.get_name_label rpc session_id pool_host) in
166169
error
167170
"Pool join: Updates differ. Only on pool host %s: {%s} -- only on local host %s: {%s}"
168171
remote_uuid
169172
(diff remote_updates local_updates)
170173
local_uuid
171174
(diff local_updates remote_updates);
172-
raise Api_errors.(Server_error(pool_hosts_not_homogeneous,reason))
175+
raise Api_errors.(Server_error(pool_hosts_not_homogeneous,[reason]))
173176
end)
174177
in
175178

0 commit comments

Comments
 (0)