Skip to content

Commit 25e0a6b

Browse files
committed
CA-225365: Trim the output of CLI commands
Signed-off-by: Rob Hoes <[email protected]>
1 parent d0b67b0 commit 25e0a6b

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

lib/network_utils.ml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -756,8 +756,12 @@ module Ovs = struct
756756

757757
let bridge_to_vlan name =
758758
try
759-
Some (vsctl ["br-to-parent"; name], int_of_string (vsctl ["br-to-vlan"; name]))
760-
with _ -> None
759+
let parent = vsctl ["br-to-parent"; name] |> String.rtrim in
760+
let vlan = vsctl ["br-to-vlan"; name] |> String.rtrim |> int_of_string in
761+
Some (parent, vlan)
762+
with e ->
763+
debug "bridge_to_vlan: %s" (Printexc.to_string e);
764+
None
761765

762766
let get_bond_link_status name =
763767
try

0 commit comments

Comments
 (0)