Skip to content

Commit 4edb0d7

Browse files
authored
CA-423213: Fix bundle URL construct (#6860)
Uri.make results in `file:/path/to/file`, rather than the correct `file:///path/to/file`. This breaks dnf's handling of bundles.
2 parents ecb82f3 + 1b37d8e commit 4edb0d7

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)