Skip to content

Commit 32fe6bc

Browse files
committed
CA-259288 provide descriptive reason when raising pool_hosts_not_homogeneous
With this commit, when pool_hosts_not_homogeneous is raised in pool-join pre-checks, it provides a descriptive error message rather than a UUID. This is now in line with other call sites of this error. The main concern here is that this string is also shown in XenCenter to the user. Signed-off-by: Christian Lindig <[email protected]>
1 parent 63e4a72 commit 32fe6bc

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
@@ -163,14 +163,17 @@ let pre_join_checks ~__context ~rpc ~session_id ~force =
163163
if not (S.equal local_updates remote_updates) then begin
164164
let remote_uuid = Client.Host.get_uuid rpc session_id pool_host in
165165
let diff xs ys = S.diff xs ys |> S.elements |> String.concat "," in
166-
let reason = [remote_uuid] in
166+
let reason =
167+
Printf.sprintf "Updates on local host %s and pool host %s differ"
168+
(Db.Host.get_name_label ~__context ~self:local_host)
169+
(Client.Host.get_name_label rpc session_id pool_host) in
167170
error
168171
"Pool join: Updates differ. Only on pool host %s: {%s} -- only on local host %s: {%s}"
169172
remote_uuid
170173
(diff remote_updates local_updates)
171174
local_uuid
172175
(diff local_updates remote_updates);
173-
raise Api_errors.(Server_error(pool_hosts_not_homogeneous,reason))
176+
raise Api_errors.(Server_error(pool_hosts_not_homogeneous,[reason]))
174177
end)
175178
in
176179

0 commit comments

Comments
 (0)