fix(bridge-api): unflatten nodes' bridge lists back

Bridge lists were erroneously flattened in cad6492c. This causes
bridge listing fail in emqx clusters consisting of more than 1 node.
This commit is contained in:
Andrew Mayorov 2023-03-21 15:23:50 +03:00
parent e2b372f7ae
commit d9b1b1c802
No known key found for this signature in database
GPG Key ID: 2837C62ACFBFED5D
1 changed files with 5 additions and 5 deletions

View File

@ -71,8 +71,8 @@
-define(BRIDGE_NOT_FOUND(BRIDGE_TYPE, BRIDGE_NAME),
?NOT_FOUND(
<<"Bridge lookup failed: bridge named '", BRIDGE_NAME/binary, "' of type ",
(atom_to_binary(BRIDGE_TYPE))/binary, " does not exist.">>
<<"Bridge lookup failed: bridge named '", (BRIDGE_NAME)/binary, "' of type ",
(bin(BRIDGE_TYPE))/binary, " does not exist.">>
)
).
@ -507,10 +507,10 @@ schema("/bridges_probe") ->
case is_ok(NodeReplies) of
{ok, NodeBridges} ->
AllBridges = [
format_resource(Data, Node)
|| {Node, Bridges} <- lists:zip(Nodes, NodeBridges), Data <- Bridges
[format_resource(Data, Node) || Data <- Bridges]
|| {Node, Bridges} <- lists:zip(Nodes, NodeBridges)
],
?OK(zip_bridges([AllBridges]));
?OK(zip_bridges(AllBridges));
{error, Reason} ->
?INTERNAL_ERROR(Reason)
end.