Skip to content

Commit e74c671

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 <[email protected]>
1 parent 1b75c36 commit e74c671

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

ocaml/xapi/repository.ml

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -169,9 +169,16 @@ 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
174-
(Uri.to_string uri, None, false, NoAuth, NoAuth)
181+
(Uri.to_string uri None, false, NoAuth, NoAuth)
175182
| `remote_pool ->
176183
let cert = Db.Repository.get_certificate ~__context ~self in
177184
let repo_binary_url = Db.Repository.get_binary_url ~__context ~self in

0 commit comments

Comments
 (0)