Skip to content

Commit

Permalink
CA-374872: error when BOND_MEMBERS is not in management.conf
Browse files Browse the repository at this point in the history
It is an optional field, handle its abscence gracefully.
Following up: #4333 (commit: e8dbc1d)

Signed-off-by: BenjiReis <[email protected]>
  • Loading branch information
benjamreis committed Jan 30, 2023
1 parent 20b0574 commit 2c57d18
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion ocaml/networkd/lib/network_config.ml
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,11 @@ let read_management_conf () =
Option.value ~default:"" (List.assoc_opt "BOND_MODE" args)
in
let bond_members =
String.split_on_char ',' (List.assoc "BOND_MEMBERS" args)
match List.assoc_opt "BOND_MEMBERS" args with
| None ->
[]
| Some x ->
String.split_on_char ',' x
in
let device =
(* Take 1st member of bond *)
Expand Down

0 comments on commit 2c57d18

Please sign in to comment.