Skip to content

Commit 6b4237f

Browse files
author
Stephen Cheng
committed
Make proxy_config non-optional
Signed-off-by: Stephen Cheng <stephen.cheng@citrix.com>
1 parent d5d976e commit 6b4237f

File tree

3 files changed

+11
-12
lines changed

3 files changed

+11
-12
lines changed

ocaml/tests/test_repository_helpers.ml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -346,8 +346,8 @@ module WriteYumConfig = Generic.MakeStateless (struct
346346
let gpgkey_path' = Option.value ~default:"" name in
347347
try
348348
(* The path of file which will be written by write_yum_config *)
349-
write_yum_config ~source_url ~binary_url ~repo_gpgcheck:true
350-
~gpgkey_path:gpgkey_path' ~repo_name () ;
349+
write_yum_config ~proxy_config:[] ~source_url ~binary_url
350+
~repo_gpgcheck:true ~gpgkey_path:gpgkey_path' ~repo_name ;
351351
let in_ch = open_in repo_file_path in
352352
let content = read_from_in_channel "" in_ch in
353353
close_in in_ch ; finally () ; Ok content

ocaml/xapi/repository.ml

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -227,9 +227,9 @@ let sync ~__context ~self ~token ~token_id ~username ~password =
227227
let proxy_config =
228228
match use_proxy with true -> get_proxy_params ~__context | false -> []
229229
in
230-
let write_initial_yum_config ?(proxy_config = proxy_config) ~binary_url () =
230+
let write_initial_yum_config ~proxy_config ~binary_url =
231231
write_yum_config ~proxy_config ~source_url ~binary_url ~repo_gpgcheck:true
232-
~gpgkey_path ~repo_name ()
232+
~gpgkey_path ~repo_name
233233
in
234234
Xapi_stdext_pervasives.Pervasiveext.finally
235235
(fun () ->
@@ -258,9 +258,8 @@ let sync ~__context ~self ~token ~token_id ~username ~password =
258258

259259
with_sync_client_auth client_auth @@ fun client_auth ->
260260
with_sync_server_auth server_auth @@ fun binary_url' ->
261-
write_initial_yum_config
262-
~binary_url:(Option.value binary_url' ~default:binary_url)
263-
() ;
261+
write_initial_yum_config ~proxy_config
262+
~binary_url:(Option.value binary_url' ~default:binary_url) ;
264263
clean_yum_cache repo_name ;
265264
(* Remove imported YUM repository GPG key *)
266265
if Pkgs.manager = Yum then
@@ -294,7 +293,7 @@ let sync ~__context ~self ~token ~token_id ~username ~password =
294293
match Pkgs.manager with
295294
| Yum ->
296295
(* Write clean config without proxy credentials *)
297-
write_initial_yum_config ~proxy_config:[] ~binary_url ()
296+
write_initial_yum_config ~proxy_config:[] ~binary_url
298297
| Dnf ->
299298
Unixext.unlink_safe !Xapi_globs.dnf_repo_config_file
300299
) ;

ocaml/xapi/repository_helpers.ml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -310,8 +310,8 @@ let remove_repo_conf_file repo_name =
310310
in
311311
Unixext.unlink_safe path
312312

313-
let write_yum_config ?(proxy_config = []) ~source_url ~binary_url ~repo_gpgcheck
314-
~gpgkey_path ~repo_name () =
313+
let write_yum_config ~proxy_config ~source_url ~binary_url ~repo_gpgcheck
314+
~gpgkey_path ~repo_name =
315315
let file_path =
316316
Filename.concat !Xapi_globs.yum_repos_config_dir (repo_name ^ ".repo")
317317
in
@@ -446,8 +446,8 @@ let with_local_repositories ~__context f =
446446
s
447447
in
448448
remove_repo_conf_file repo_name ;
449-
write_yum_config ~source_url:None ~binary_url ~repo_gpgcheck:false
450-
~gpgkey_path ~repo_name () ;
449+
write_yum_config ~proxy_config:[] ~source_url:None ~binary_url
450+
~repo_gpgcheck:false ~gpgkey_path ~repo_name ;
451451
clean_yum_cache repo_name ;
452452
let Pkg_mgr.{cmd; params} =
453453
[

0 commit comments

Comments
 (0)