Skip to content

Commit

Permalink
use ohex instead of hex
Browse files Browse the repository at this point in the history
  • Loading branch information
hannesm committed May 8, 2024
1 parent af919c9 commit 69ebd8c
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion albatross.opam
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ depends: [
"metrics-lwt" {>= "0.2.0"}
"metrics-influx" {>= "0.2.0"}
"metrics-rusage"
"hex"
"ohex" {>= "0.2.0"}
"http-lwt-client" {>= "0.2.0"}
"happy-eyeballs-lwt"
"solo5-elftool" {>= "0.3"}
Expand Down
2 changes: 1 addition & 1 deletion client/albatross_client.ml
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ let prepare_update ~happy_eyeballs level host dryrun = function
| Ok (_hdr, `Success (`Unikernel_info
[ _name, Vmm_core.Unikernel.{ digest ; bridges ; block_devices ; argv ; cpuid ; memory ; fail_behaviour ; typ = `Solo5 as typ ; _ } ])) ->
begin
let `Hex hash = Hex.of_cstruct digest in
let hash = Ohex.encode (Cstruct.to_string digest) in
can_update ~happy_eyeballs host hash >>= function
| Error `Msg msg ->
Logs.err (fun m -> m "error in HTTP interaction: %s" msg);
Expand Down
2 changes: 1 addition & 1 deletion src/dune
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
(modules vmm_core vmm_commands vmm_compress vmm_trie vmm_trie vmm_ring vmm_asn vmm_resources)
(libraries logs ipaddr ptime duration cstruct bigstringaf
decompress.de decompress.zl asn1-combinators fpath
metrics mirage-crypto hex))
metrics mirage-crypto ohex))

(library
(name albatross_unix)
Expand Down
4 changes: 2 additions & 2 deletions src/vmm_core.ml
Original file line number Diff line number Diff line change
Expand Up @@ -370,7 +370,7 @@ module Unikernel = struct
}

let pp ppf vm =
let `Hex hex_digest = Hex.of_cstruct vm.digest in
let hex_digest = Ohex.encode (Cstruct.to_string vm.digest) in
Fmt.pf ppf "pid %d@ taps %a (block %a) cmdline %a digest %s"
vm.pid
Fmt.(list ~sep:(any ", ") string) vm.taps
Expand All @@ -397,7 +397,7 @@ module Unikernel = struct
bridges = cfg.bridges ; argv = cfg.argv ; digest = t.digest ; started = t.started }

let pp_info ppf (info : info) =
let `Hex hex_digest = Hex.of_cstruct info.digest in
let hex_digest = Ohex.encode (Cstruct.to_string info.digest) in
Fmt.pf ppf "typ %a@ started %a@ fail behaviour %a@ cpu %d@ %d MB memory@ block devices %a@ bridge %a@ digest %s"
pp_typ info.typ
(Ptime.pp_rfc3339 ()) info.started
Expand Down

0 comments on commit 69ebd8c

Please sign in to comment.