Skip to content

Commit 1b37d8e

Browse files
committed
CA-423213: Fix bundle URL construct
Without the host parameter, Uri.make returns `file:/path/to/file`. dnf expects the `file:///path/to/file` variant - using the single slash variant leads to a failure to locate the signature file. Signed-off-by: Alex Brett <alex.brett@citrix.com>
1 parent 1b75c36 commit 1b37d8e

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

ocaml/xapi/repository.ml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,14 @@ let sync ~__context ~self ~token ~token_id ~username ~password =
169169
)
170170
| `bundle ->
171171
let uri =
172-
Uri.make ~scheme:"file" ~path:!Xapi_globs.bundle_repository_dir ()
172+
(* dnf requires a URI that is file:///absolute/path, using the
173+
* file:/absolute/path variant will result in a failure to locate
174+
* the signature file, thus the host parameter to Uri.make is
175+
* required
176+
*)
177+
Uri.make ~scheme:"file" ~host:""
178+
~path:!Xapi_globs.bundle_repository_dir
179+
()
173180
in
174181
(Uri.to_string uri, None, false, NoAuth, NoAuth)
175182
| `remote_pool ->

0 commit comments

Comments
 (0)