Skip to content

Commit

Permalink
Temporary patch
Browse files Browse the repository at this point in the history
Currently riak develop-3.0 does not support basho-patches in the code path.  Bodge this so we can still add and save a patch (maybe - or perhaps just adding the path this way won't have the intercept survive the reboot?).

basho/riak#994
  • Loading branch information
martinsumner committed Oct 28, 2019
1 parent 7d22fda commit b8b4571
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/rt_intercept.erl
Expand Up @@ -61,8 +61,15 @@ load_code(Node, Globs) ->

add_and_save(Node, Intercepts) ->
CodePaths = rpc:call(Node, code, get_path, []),
[PatchesDir] = [P || P <- CodePaths, lists:suffix("basho-patches", P)],
add(Node, Intercepts, PatchesDir).
ok =
case [P || P <- CodePaths, lists:suffix("basho-patches", P)] of
[PatchesDir] ->
add(Node, Intercepts, PatchesDir);
[] ->
lager:error("No basho-patches! Manually adding path"),
add(Node, Intercepts, "lib/basho-patches")
end,
ok.

add(Node, Intercepts) ->
add(Node, Intercepts, undefined).
Expand Down

0 comments on commit b8b4571

Please sign in to comment.