Skip to content

Commit

Permalink
fixup! CA-390277: Stop using records on CLI cross-pool migrations
Browse files Browse the repository at this point in the history
  • Loading branch information
psafont committed Jun 20, 2024
1 parent cc5b096 commit 336a029
Showing 1 changed file with 12 additions and 13 deletions.
25 changes: 12 additions & 13 deletions ocaml/xapi-cli-server/cli_operations.ml
Original file line number Diff line number Diff line change
Expand Up @@ -4330,10 +4330,10 @@ let vm_migrate printer rpc session_id params =
)
in
let all_hosts = remote Client.Host.get_all in
match List.filter matches all_hosts with
| host :: _ ->
match List.find_opt matches all_hosts with
| Some host ->
host
| [] ->
| None ->
failwith fail_msg
in
let network =
Expand All @@ -4346,29 +4346,28 @@ let vm_migrate printer rpc session_id params =
match List.assoc_opt "remote-network" params with
| Some x -> (
let all_networks = remote Client.Network.get_all in
match List.filter (network_matches x) all_networks with
| network :: _ ->
match List.find_opt (network_matches x) all_networks with
| Some network ->
network
| [] ->
| None ->
failwith (Printf.sprintf "Failed to find network: %s" x)
)
| None -> (
let pifs = remote (Client.Host.get_PIFs ~self:host) in
let management_pifs =
List.filter
let management_pif =
List.find_opt
(fun self -> remote (Client.PIF.get_management ~self))
pifs
in
match management_pifs with
| [] ->
match management_pif with
| None ->
let host_uuid = remote (Client.Host.get_uuid ~self:host) in
failwith
(Printf.sprintf "Could not find management PIF on host %s"
host_uuid
)
| pif :: _ ->
let net = remote (Client.PIF.get_network ~self:pif) in
net
| Some pif ->
remote (Client.PIF.get_network ~self:pif)
)
in
let vif_map =
Expand Down

0 comments on commit 336a029

Please sign in to comment.