Skip to content

Commit 3220f12

Browse files
committed
CP-308450 Use the position in new network name_label
Do not use the device name in the new created network name_label if the device has a position. Given the fact that device names may be different on different hosts of the pool, even they are of the same position. So it is more proper to just use the position in the network name_label. Also this will be good for interface name change scenario as this change will not reflect in this default network name_label. Signed-off-by: Changlei Li <changlei.li@cloud.com>
1 parent 8145ce6 commit 3220f12

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

ocaml/xapi/helpers.ml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -129,11 +129,11 @@ let call_script ?(log_output = Always) ?env ?stdin ?timeout script args =
129129
raise e
130130

131131
(** Construct a descriptive network name (used as name_label) for a give network interface. *)
132-
let choose_network_name_for_pif device pos_opt =
133-
let pos_str =
134-
Option.fold ~none:"" ~some:(Printf.sprintf " (slot %d)") pos_opt
135-
in
136-
Printf.sprintf "Pool-wide network associated with %s%s" device pos_str
132+
let choose_network_name_for_pif device = function
133+
| Some pos ->
134+
Printf.sprintf "Pool-wide network %d" pos
135+
| None ->
136+
Printf.sprintf "Pool-wide network associated with %s" device
137137

138138
(* !! FIXME - trap proper MISSINGREFERENCE exception when this has been defined *)
139139
(* !! FIXME(2) - this code could be shared with the CLI? *)

0 commit comments

Comments
 (0)