Skip to content

Commit ae8e206

Browse files
thomassagaborigloi
authored andcommitted
CA-268279: Fix self-conflicting network purposes
If any network had any purpose, this was being treated as a conflict with the addition of any purpose to any network. Signed-off-by: Thomas Sanders <[email protected]>
1 parent 8020bee commit ae8e206

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

ocaml/xapi/xapi_network.ml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -343,9 +343,11 @@ let assert_can_add_purpose ~__context ~network ~current newval =
343343
Db.Network.get_all ~__context |>
344344
List.iter (fun nwk ->
345345
Db.Network.get_purpose ~__context ~self:nwk |>
346-
List.iter (fun suspect -> if (List.mem suspect bads) then
347-
info "Cannot set new network purpose %s when there is a network with purpose %s" (sop newval) (sop suspect);
348-
reject (sop suspect)
346+
List.iter (fun suspect ->
347+
if (List.mem suspect bads) then (
348+
info "Cannot set new network purpose %s when there is a network with purpose %s" (sop newval) (sop suspect);
349+
reject (sop suspect)
350+
)
349351
)
350352
)
351353
in

0 commit comments

Comments
 (0)