Skip to content

Commit

Permalink
CP-39551: avoid warnings from PR xapi-project#4659
Browse files Browse the repository at this point in the history
Signed-off-by: Pau Ruiz Safont <pau.safont@citrix.com>
  • Loading branch information
psafont committed Apr 13, 2022
1 parent 16e3bf2 commit 02b3944
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 14 deletions.
2 changes: 1 addition & 1 deletion ocaml/xapi-cli-server/records.ml
Original file line number Diff line number Diff line change
Expand Up @@ -1384,7 +1384,7 @@ let pool_record rpc session_id pool =
; make_field ~name:"uefi-certificates" ~hidden:true
~get:(fun () -> (x ()).API.pool_uefi_certificates)
~set:(fun value ->
Client.Pool.set_uefi_certificates rpc session_id pool value
Client.Pool.set_uefi_certificates ~rpc ~session_id ~self:pool ~value
)
()
; make_field ~name:"tls-verification-enabled"
Expand Down
6 changes: 2 additions & 4 deletions ocaml/xapi/xapi.ml
Original file line number Diff line number Diff line change
Expand Up @@ -1410,10 +1410,8 @@ let server_init () =
; ( "Sync UEFI certificates on host with XAPI db"
, [Startup.NoExnRaising]
, fun () ->
Helpers.call_api_functions ~__context (fun rpc session_id ->
Xapi_host.write_uefi_certificates_to_disk __context
(Helpers.get_localhost ~__context)
)
Xapi_host.write_uefi_certificates_to_disk ~__context
~host:(Helpers.get_localhost ~__context)
)
] ;
debug "startup: startup sequence finished"
Expand Down
8 changes: 4 additions & 4 deletions ocaml/xapi/xapi_host.ml
Original file line number Diff line number Diff line change
Expand Up @@ -2572,7 +2572,7 @@ let with_temp_file_contents ~contents f =
)
(fun () -> Sys.remove filename)

let write_uefi_certificates_to_disk ~__context ~host =
let write_uefi_certificates_to_disk ~__context ~host:_ =
if
Sys.file_exists !Xapi_globs.varstore_dir
&& Sys.is_directory !Xapi_globs.varstore_dir
Expand Down Expand Up @@ -2606,9 +2606,9 @@ let write_uefi_certificates_to_disk ~__context ~host =
let set_uefi_certificates ~__context ~host ~value =
Db.Host.set_uefi_certificates ~__context ~self:host ~value ;
Helpers.call_api_functions ~__context (fun rpc session_id ->
Client.Client.Pool.set_uefi_certificates rpc session_id
(Helpers.get_pool ~__context)
value
Client.Client.Pool.set_uefi_certificates ~rpc ~session_id
~self:(Helpers.get_pool ~__context)
~value
)

let set_iscsi_iqn ~__context ~host ~value =
Expand Down
10 changes: 5 additions & 5 deletions ocaml/xapi/xapi_pool.ml
Original file line number Diff line number Diff line change
Expand Up @@ -1546,16 +1546,16 @@ let join_common ~__context ~master_address ~master_username ~master_password
( try
let _uefi_certs =
Client.Pool.get_uefi_certificates ~rpc ~session_id
~self:(get_pool rpc session_id)
~self:(get_pool ~rpc ~session_id)
in
Db.Pool.set_uefi_certificates ~__context
~self:(Helpers.get_pool ~__context)
~value:_uefi_certs ;
Helpers.call_api_functions ~__context
(fun local_rpc local_session_id ->
Client.Host.write_uefi_certificates_to_disk local_rpc
local_session_id
(Helpers.get_localhost ~__context)
Client.Host.write_uefi_certificates_to_disk ~rpc:local_rpc
~session_id:local_session_id
~host:(Helpers.get_localhost ~__context)
)
with e ->
error
Expand Down Expand Up @@ -3589,7 +3589,7 @@ let set_uefi_certificates ~__context ~self ~value =
Helpers.call_api_functions ~__context (fun rpc session_id ->
List.iter
(fun host ->
Client.Host.write_uefi_certificates_to_disk rpc session_id host
Client.Host.write_uefi_certificates_to_disk ~rpc ~session_id ~host
)
(Db.Host.get_all ~__context)
)

0 comments on commit 02b3944

Please sign in to comment.